CLI

Tool

The CHING command-line interface. Sign in once via your browser, then manage products, prices, and customers from your terminal. Useful for seeding catalogs, scripting test data, and doing one-shot ops without leaving the shell.

@ching-payments/cli
Run with npx, or install globally with npm install -g.
npx @ching-payments/cli login

Install

Use npx for one-off use, or install globally so the binary is just ching:

# One-off
npx @ching-payments/cli <command>

# Or install globally
npm install -g @ching-payments/cli
ching <command>

Requires Node.js 18 or newer.

Sign in

The default flow opens your browser to app.ching.co.il/cli/authorize. After you click Authorize, the CLI captures a long-lived session token (180 days), picks your active project, and defaults to test mode.

ching login

For headless contexts (CI, SSH, container) where no browser is available, paste an API key instead:

ching login --with-key
Revoking access: Browser sessions appear under API keys → CLI sessions in the dashboard. Revoke any session there and the matching CLI on that machine stops working immediately.

Manage your catalog

Create a product and a recurring price in two commands:

ching products create \
  --name "Pro plan" \
  --description "Full access to everything" \
  --feature "Unlimited usage|No throttling" \
  --feature "Priority support"

ching prices create \
  --product prod_abc123 \
  --amount 4990 \
  --type recurring \
  --interval month

Amounts are always in agorot - the smallest ILS unit. ₪49.90 becomes --amount=4990. The CLI rejects decimals with a clear conversion hint.

Run any command with no required flags inside a TTY and the CLI walks you through an interactive prompt instead. In non-TTY contexts (CI), the same command exits with a clear "missing flag" error.

Install the AI skill

Run one command and the CHING integration skill is installed in your AI tools. Currently supports Claude Code (~/.claude/skills/) and Cursor (~/.cursor/rules/). The skill itself lives at github.com/ching-payments/skill- re-run the install command any time to pick up updates.

ching skill install

The installer prompts you for the install scope:

  • Globally - ~/.claude/skills/ and ~/.cursor/rules/. Available in every project on this machine.
  • Current project only - ./.claude/skills/ and ./.cursor/rules/. Lives in this folder and ships to teammates via git.

It also pre-selects the AI tools it detects (the presence of ~/.claude or ~/.cursor) so you only land the skill where it will actually be used.

When the upstream skill changes, refresh your install with ching skill update. The update command also asks you which scope to refresh, and only touches AI tools where the skill is already installed at that scope - it never silently expands to new tools.

ching skill update

Skip the prompts entirely with flags:

ching skill install --global --target=claude,cursor --force
ching skill install --project --target=claude

ching skill update --global
ching skill update --project --target=cursor

ching skill uninstall --global
ching skill list
Restart your AI tool (or open a new chat) after installing or updating - skills are loaded once at session start.

Manage projects

List the projects you have access to (the active one is marked) and create new ones, all without leaving the terminal:

ching projects list
ching projects create --name "My new shop"

A freshly created project becomes active automatically if you had no active project. To override that:

ching projects create --name "Side experiment" --switch       # adopt as active
ching projects create --name "Side experiment" --no-switch    # keep current

Switch projects and modes

One sign-in lets you operate on any project you have access to, in test or live mode. The active selection persists in ~/.ching/config.json:

ching use proj_mystore       # by visible id (or numeric id)
ching use --live             # flip the active session to live
ching use --test             # back to test

Or override per command without changing your active session:

ching prices list --live
ching products create --name=test --project 42

Live writes from a TTY get a confirm prompt. Pass --yes to skip it in scripts.

Commands

CommandWhat it does
ching login [--with-key]Sign in via the browser, or paste an API key
ching logout [--revoke]Sign out locally, optionally revoking the server-side session
ching whoamiPrint user, project, mode, masked credentials
ching use <project>Switch active project (visible id or numeric id)
ching use --live | --testSwitch active mode
ching open [page]Open a dashboard page in the browser
ching skill install / update / uninstall / listInstall, refresh, or remove the CHING AI skill in Claude Code / Cursor
ching projects list / createList your projects or create a new one
ching products list / get / create / updateManage products
ching prices list / get / createManage prices
ching customers list / get / createManage customers

Run ching <command> --help for the full flag listing.

Global flags

These work on every command:

FlagWhat it does
--jsonRaw JSON output instead of styled tables. Errors are emitted as { "error": { ... } } on stderr.
--project <id>Override the active project for one call (numeric id)
--live | --testOverride the active mode for one call
--yesSkip the confirm prompt for live writes

Where credentials live

The CLI persists exactly one file: ~/.ching/config.json with mode 0600. Browser sign-in stores a JWT-style session token; the paste-key flow stores an API key in the same file.

{
  "version": 1,
  "token": "ey...",
  "user": {
    "id": "user_abc",
    "email": "you@example.com"
  },
  "session": {
    "id": 42,
    "name": "your-mac",
    "hostname": "your-mac"
  },
  "active_project": {
    "id": 7,
    "visibleId": "proj_mystore",
    "name": "My Store"
  },
  "active_mode": "test"
}
Don't commit this file: the token grants the same access you have in the dashboard. If a machine is compromised, revoke its session from API keys → CLI sessions.

Scripting against the CLI

Add --json for machine-readable output. The CLI follows the same envelope as the REST API for errors, and exits non-zero so set -e catches failures cleanly:

#!/usr/bin/env bash
set -euo pipefail

product_id=$(ching products create --name "Pro plan" --json | jq -r '.id')
ching prices create --product "$product_id" --amount 4990 \
  --type recurring --interval month --json