@cargo-ai/cli
v1.0.8
Published
Command-line interface for the Cargo API
Readme
Cargo CLI
Command-line interface for the Cargo API. Manage workspaces, storage, orchestration, connections, billing, and more from the terminal; for a complete feature overview, see the Cargo CLI Overview.
Requirements
- Node.js 22.x
- A Cargo API token (create in your workspace under Settings → API)
Installation
Install from npm (global):
npm install -g @cargo-ai/cliOr run once with npx without installing:
npx @cargo-ai/cli orchestration workflow listAuthentication
Login (recommended)
cargo-ai login --token <your-api-token>Credentials are stored in ~/.config/cargo-ai/credentials.json (file mode 0600).
# Check current auth status
cargo-ai whoami
# Remove saved credentials
cargo-ai logoutEnvironment variables (override)
Environment variables take precedence over saved credentials, useful for CI or temporary overrides.
| Variable | Default | Description |
| ---------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
| CARGO_API_TOKEN | — | Your Cargo API token (Bearer auth) |
| CARGO_BASE_URL | https://api.getcargo.io | API base URL |
| CARGO_WORKSPACE_UUID | — | Workspace UUID for workspace-scoped commands (some commands also accept --workspace-uuid) |
Usage
Command structure: cargo-ai <domain> <sub> <action>.
After a global install, run:
cargo-ai <domain> <sub> <action>Without installing, use npx:
npx @cargo-ai/cli <domain> <sub> <action>All commands output JSON to stdout.
Help
cargo-ai --help
cargo-ai orchestration --help
cargo-ai orchestration workflow --helpDomains and example commands
| Domain | Description | Example commands |
| ------------------------ | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| init | Workspace initialisation (user, workspace, datasets, etc.) | cargo-ai init |
| orchestration | Workflows, plays, runs, batches, tools, templates | cargo-ai orchestration workflow list, cargo-ai orchestration run list --workflow-uuid <uuid> |
| workspace | Workspaces, users, tokens, roles, folders | cargo-ai workspace workspaces list, cargo-ai workspace token list |
| storage | Datasets, models, relationships, runs, records | cargo-ai storage dataset list, cargo-ai storage model list |
| connection | Connectors and integrations | cargo-ai connection connector list, cargo-ai connection integration list |
| billing | Usage and subscription | cargo-ai billing subscription get, cargo-ai billing usage get-metrics --payload '{"from":"2025-01-01","to":"2025-01-31"}' |
| segmentation | Segments and changes | cargo-ai segmentation segment list, cargo-ai segmentation change list --payload '{}' |
| revenue-organization | Allocations, capacities, members, territories | cargo-ai revenue-organization member list, cargo-ai revenue-organization territory list |
| expression | Recipes and expression evaluation | cargo-ai expression recipe list, cargo-ai expression eval evaluate --payload '{}' |
| system-of-record | System of record, client, logs | cargo-ai system-of-record sor list, cargo-ai system-of-record log list --payload '{}' |
| user-management | Current user (no workspace context) | cargo-ai user-management user get-current |
| ai | AI templates, agents, releases, chats, MCP, files | cargo-ai ai template list, cargo-ai ai agent list, cargo-ai ai file list |
| context | Context repository, files, and skills | cargo-ai context skill list, cargo-ai context skill get --slug <slug>, cargo-ai context file list |
Commands that accept complex payloads use a --payload <json> option (e.g. cargo-ai orchestration play create --payload '{"name":"My Play",...}'). Use --help on any subcommand for options.
Agent Skills
Cargo Skills teaches AI coding agents (Claude Code, Cursor, Windsurf, GitHub Copilot, etc.) how to use the Cargo CLI. Install the skill to let your agent build, run, and manage revenue automation workflows programmatically:
npx skills add getcargohq/cargo-skillsDevelopment
# Build
npm run build
# Run with tsx (no build)
npm run dev
# then in another terminal: npx tsx src/index.ts orchestration workflow list
# Type-check and lint
npm run type:check
npm run lint:checkLicense
See the project for license information.
