Skip to main content

Command-line access to Chift

Use the Chift CLI to discover Chift API operations, inspect required inputs, and call Unified API endpoints with structured output from your terminal or coding agent. 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 for endpoints that act 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.
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.
You can also pass credentials directly for non-interactive use:
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.
To update an existing install:

Agent skill

The CLI ships with an agent skill that teaches coding agents how to drive it. Install the skill with the skills CLI:

Discovering and calling endpoints

Inspecting endpoint inputs

Use --schema or --next to see the merged input schema before calling an endpoint. The CLI rejects unknown parameters before sending any request.

Passing inputs

consumer_id is route context. Set it once via environment variable or pass it as the first positional argument:
Pass other path and query parameters as KEY=VALUE positional values or with --param:

Posting data

For POST and PATCH operations, pass a JSON body with --json or use KEY=VALUE pairs. Mutating operations require --force.

Output and filtering

API commands return JSON by default. Use --output yaml for YAML, or --debug to write debug logs to stderr.
--fields keeps only selected fields from the response. --filter filters list responses client-side. For paginated responses, the CLI applies both to the items array. Pagination uses the API’s own page and size query parameters.

Environment variables

The CLI loads environment variables at startup from a .env file or shell exports.

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.
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:

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, and debugging sessions. Use it whenever you want to see the exact API request and response shape.