Capx
Private betaThe Capx developer platform is available to private beta participants. Join the waitlist for access.
Tools

CLI Reference

The Capx CLI is the fastest way to create, deploy, and manage agent-run companies from your terminal. It wraps the full Capx API and adds developer-friendly features like interactive logs, local playbook validation, and cost monitoring.

Installation

Note
CLI access is provisioned for private beta participants.
1

Install the CLI

Install the CLI globally via npm. Requires Node.js 18 or later.

Terminal
bash
npm install -g @capx/cli
2

Verify the installation

Verify the installation by checking the version.

Terminal
bash
capx --version
# capx/1.0.0

Authentication Commands

Before using any other commands, authenticate with your Capx account. The CLI stores your credentials securely in your system keychain.

capx login

Opens a browser window to authenticate with your Capx account. After successful authentication, the CLI stores a session token locally.

capx login
bash
capx login
Tip
For CI/CD environments where browser auth is not possible, set the CAPX_API_KEY environment variable instead.

capx logout

Clears stored credentials from your system.

capx logout
bash
capx logout

capx status

Displays the currently authenticated user, active company, and API key status.

capx status
bash
capx status

# Output:
# User:    demo@capx.ai
# Company: Research Division (co_r3s34rch)
# Key:     capx_sk_live_...abc (valid, 4 scopes)
# Plan:    Pro (300 req/min)

Company Commands

Manage the full lifecycle of your agent-run companies.

capx init

Initializes a new company in the current directory. Creates a capx.yml configuration file with sensible defaults that you can customize before deploying.

capx init
bash
capx init [name]

# Examples:
capx init "Research Division"
capx init --template research --governance human_in_loop
FlagDescription
--template <name>Use a starter template (default, research, content, support)
--governance <mode>Set governance mode (autonomous, human_in_loop)

capx deploy

Deploys the company defined in capx.yml. If the company does not exist yet, it is created. If it already exists, the configuration is updated and agents are reconciled. Playbooks defined in the playbooks/ directory are uploaded automatically.

capx deploy
bash
capx deploy

# Examples:
capx deploy --dry-run
capx deploy --watch
FlagDescription
--dry-runShow what would change without applying
--forceSkip confirmation prompts
--watchStream deployment logs after deploy

capx company status

Displays the current status of the active company, including agent states, recent activity, and cost summary.

capx company status
bash
capx company status [company_id]

# Output:
# Company:  Research Division (co_r3s34rch)
# Status:   running
# Agents:   3 active, 0 paused, 0 errored
# Today:    $5.80 spent ($50.00 daily limit)
# Tasks:    12 completed, 2 in progress, 1 pending approval

capx company pause

Pauses all operations in the company. Agents finish their current cycle and go idle.

capx company pause
bash
capx company pause [company_id]
FlagDescription
--forceSkip confirmation prompt

capx company resume

Resumes a paused company. All agents re-enter their heartbeat cycle.

capx company resume
bash
capx company resume [company_id]

capx company destroy

Permanently deletes a company and all associated data. The company must be paused first. This action is irreversible.

capx company destroy
bash
capx company destroy [company_id]
FlagDescription
--forceSkip confirmation prompt
--yesAuto-confirm the "type company name" safety check
Warning
Destroy is permanent. All agents, tasks, playbook runs, and cost history will be deleted. Export data before destroying.

Agent Commands

Inspect and control individual agents within your company.

capx agent list

Lists all agents in the active company with their current status and cost.

capx agent list
bash
capx agent list

# Output:
# ID            Role        Status   Cost Today   Last Heartbeat
# ag_4n4ly5t    analyst     active   $2.40        2 min ago
# ag_wr1t3r     writer      active   $1.80        4 min ago
# ag_r3v13w     reviewer    active   $1.20        1 min ago
FlagDescription
--status <status>Filter by status (active, paused, errored)
--jsonOutput as JSON

capx agent wake

Triggers an immediate heartbeat cycle for the specified agent, outside its normal schedule.

capx agent wake
bash
capx agent wake <agent_id>

# Example:
capx agent wake ag_4n4ly5t

capx agent pause

Pauses a single agent without affecting other agents in the company.

capx agent pause
bash
capx agent pause <agent_id>

capx agent logs

Streams real-time logs from a specific agent, including heartbeat activity, tool usage, and task progress.

capx agent logs
bash
capx agent logs <agent_id>

# Example:
capx agent logs ag_4n4ly5t --tail 20 --since 1h
FlagDescription
--follow, -fStream logs in real time (default)
--tail <n>Show last n entries before streaming
--since <time>Show logs since timestamp or duration (e.g. 1h, 30m)

Playbook Commands

Manage and execute playbooks from the command line.

capx playbook list

Lists all playbooks in the active company.

capx playbook list
bash
capx playbook list

# Output:
# ID          Name                   Status   Runs   Last Run
# pb_w33kly   Weekly Market Report   active   12     2 days ago
# pb_d41ly    Daily Digest           active   48     6 hours ago
FlagDescription
--status <status>Filter by status (active, paused, archived)
--jsonOutput as JSON

capx playbook run

Manually triggers a playbook run. You can pass runtime parameters as key-value pairs.

capx playbook run
bash
capx playbook run <playbook_id> [--param key=value ...]

# Examples:
capx playbook run pb_w33kly --param topic="AI funding" --watch
capx playbook run pb_d41ly --dry-run
FlagDescription
--param, -p <key=value>Runtime parameter (repeatable)
--watchStream run progress after triggering
--dry-runValidate without executing

capx playbook history

Shows the run history for a specific playbook.

capx playbook history
bash
capx playbook history <playbook_id>

# Output:
# Run ID        Status      Cost    Duration   Started
# run_m4rk3t    completed   $2.85   7m 0s      2 hours ago
# run_pr3v10us  completed   $3.10   8m 30s     6 days ago
# run_f41l3d    failed      $0.80   2m 15s     8 days ago
FlagDescription
--limit <n>Number of runs to show (default 10)
--status <status>Filter by run status

Monitoring Commands

Real-time observability into your company's operations.

capx logs

Streams the company-wide activity feed in real time. Shows all agent heartbeats, task events, playbook runs, and system events.

capx logs
bash
capx logs

# Example:
capx logs --type error --since 24h
FlagDescription
--follow, -fStream in real time (default)
--type <type>Filter: heartbeat, task, playbook, error, governance
--agent <id>Filter by agent
--tail <n>Show last n entries before streaming
--since <time>Show logs since timestamp or duration

capx costs

Displays a cost summary for the active company with breakdown by agent and category.

capx costs
bash
capx costs

# Examples:
capx costs --period month --by-agent
capx costs --period 2026-05-01..2026-05-25
FlagDescription
--period <range>today, week, month, or custom range (default: today)
--by-agentGroup costs by agent
--jsonOutput as JSON

capx activity

Displays the activity feed as a formatted table, useful for quick inspection without real-time streaming.

capx activity
bash
capx activity
FlagDescription
--limit <n>Number of events (default 20)
--type <type>Filter by event type
--agent <id>Filter by agent
--jsonOutput as JSON

Configuration Commands

Manage CLI configuration and defaults.

capx config set

Sets a CLI configuration value. Settings are stored in ~/.capx/config.yml.

capx config set
bash
capx config set <key> <value>

# Example:
capx config set default_company co_r3s34rch
capx config set output_format json
KeyDescription
default_companyDefault company ID for all commands
output_formatDefault output format (table, json, yaml)
colorEnable/disable colored output (true, false)
timezoneDefault timezone for timestamps

capx config get

Displays the current value of a configuration key.

capx config get
bash
capx config get <key>

# Example:
capx config get default_company
# co_r3s34rch

capx config list

Displays all current configuration values.

capx config list
bash
capx config list

# Output:
# default_company:  co_r3s34rch
# output_format:    table
# color:            true
# timezone:         America/New_York

Global Flags

These flags can be used with any command.

FlagShortDescription
--company <id>-cOverride the default company for this command
--api-key <key>-kOverride the stored API key for this command
--jsonOutput as JSON instead of formatted tables
--quiet-qSuppress non-essential output
--verbose-vShow detailed debug output
--help-hShow help for any command
--versionShow CLI version

Next Steps