Skip to main content

Command-line access to Chift

The Chift CLI gives developers and AI agents a terminal-first way to discover Chift API operations, inspect required inputs, and call Unified API endpoints with structured output. Chift’s API is organized around consumers, connections, integrations, and Unified APIs such as accounting, POS, ecommerce, invoicing, banking, payment, and PMS. The CLI keeps those concepts close to the terminal: most API commands follow the same grouped structure as the API reference and use the consumer_id as the route context when an endpoint acts on a specific consumer.

Agent-friendly execution

Return structured JSON or YAML and keep responses focused for smaller AI context.

Open source

View the source, report issues, or contribute on GitHub.

Installation

1

Install the CLI

Download and install the latest release with a single command.
curl -fsSL https://raw.githubusercontent.com/chift-oneapi/chift-cli/master/install.sh | sh
2

Configure authentication

Save your Chift account ID, client ID, and client secret once. The CLI validates the credentials by fetching an access token. Missing values open an interactive terminal form.
chift auth setup
chift auth check
You can also pass credentials directly for non-interactive use:
chift auth setup \
  --account-id <account_id> \
  --client-id <client_id> \
  --client-secret <client_secret>
3

First use

On first use the CLI fetches and caches the OpenAPI schema automatically. Browse available commands, search for an operation, or use --next at any level to see what to do next.
chift --help
chift accounting --help
chift schema search supplier
chift accounting suppliers --next
To update an existing install:
chift update

Agent skill

The CLI ships with an agent skill that teaches coding agents how to drive it. Install the skill with the skills CLI:
npx skills add chift-oneapi/chift-cli

Discovering and calling endpoints

Inspecting endpoint inputs

Use --schema or --next to see the merged input schema before calling an endpoint. Unknown parameters are rejected before any request is sent.
chift accounting suppliers get --schema
chift accounting suppliers get --next

Passing inputs

consumer_id is route context. Set it once via environment variable or pass it as the first positional argument:
export CHIFT_CONSUMER_ID=<consumer_id>
chift accounting folders list

# or inline:
chift accounting folders list <consumer_id>
Other path and query parameters are passed as KEY=VALUE positional values or with --param:
chift accounting suppliers get <consumer_id> supplier_id=<supplier_id>

chift accounting suppliers get <consumer_id> \
  --param supplier_id=<supplier_id> \
  --param folder_id=<folder_id>

Posting data

For POST and PATCH operations, pass a JSON body with --json or use KEY=VALUE pairs. Mutating operations require --force.
chift accounting suppliers create <consumer_id> \
  --force \
  name="Acme Corp" \
  currency_code=EUR

chift accounting suppliers create <consumer_id> \
  --force \
  --json '{"name": "Acme Corp", "currency_code": "EUR"}'

Output and filtering

API commands return JSON by default. Use --output yaml for YAML, or --debug to write debug logs to stderr.
chift accounting folders list <consumer_id> --fields id,name,parent.id
chift accounting suppliers list <consumer_id> --filter name=Acme
chift accounting suppliers list <consumer_id> page=2 size=50
--fields keeps only selected fields from the response. --filter filters list responses client-side. For paginated responses both are applied to the items array. Pagination uses the API’s own page and size query parameters.

Environment variables

Environment variables are loaded at startup via a .env file or shell exports.
VariableDescriptionDefault
CHIFT_CONSUMER_IDDefault consumer, avoids passing consumer_id on every command
CHIFT_ALLOWED_OPERATIONSComma-separated list of allowed operation classes: read, write, dangerous, allall
CHIFT_SHOW_PLATFORM_ENDPOINTSShow consumers, integrations, and connections endpoint groupsfalse
CHIFT_SHOW_INTERNAL_ENDPOINTSShow general, datastores, syncs, issues, m-c-p, and webhooks endpoint groupsfalse

Restricting operations

Set CHIFT_ALLOWED_OPERATIONS to limit which operation classes the CLI executes for business vertical endpoints. This is particularly useful for AI agents that should only read data.
CHIFT_ALLOWED_OPERATIONS=read chift accounting suppliers list <consumer_id>
Scope metadata takes precedence when present. Without scopes, GET/HEAD/OPTIONS are read, POST/PATCH are write, and DELETE is dangerous. Platform and internal endpoint groups keep their full command set regardless of this setting.

Schema cache

The command tree is generated from the OpenAPI schema. The CLI fetches and caches the schema automatically on first use. Refresh it manually when needed:
chift schema update
chift schema tree
chift schema search invoice

Why it helps AI workflows

AI coding tools work best when they can discover capabilities, inspect schemas, and receive compact structured output. The Chift CLI supports that workflow by:
  • Discovering available Chift API operations from the terminal
  • Guiding agents step-by-step with --next at any command level
  • Inspecting the inputs required by an endpoint before sending a request
  • Returning JSON by default, with YAML available when needed
  • Reducing large responses with --fields and --filter
  • Restricting operations with CHIFT_ALLOWED_OPERATIONS so agents only perform safe actions
  • Requiring --force for mutating operations such as POST, PATCH, PUT, and DELETE
For AI agents, start with chift auth check, use chift schema search or --help to discover the right endpoint, then call --schema before sending business data. Set CHIFT_ALLOWED_OPERATIONS=read to prevent accidental writes.

Relationship with MCP

The Chift MCP server is the recommended option when your AI tool supports MCP and should access Chift through a tool interface. The CLI is a strong complement for terminal-based agents, local scripts, CI checks, debugging sessions, and quick exploration when you want to see the exact API request and response shape.