Reference

CLI Reference

Complete reference for all npx astra subcommands and their options.

npx astra

Start the Open Astra gateway server. Runs the first-run wizard if no config exists at ~/.astra/config.json.

bash
npx astra [options]

Options:
  --port <n>         Override the port from config (default: 3000)
  --config <path>    Use a custom config file (default: ~/.astra/config.json)
  --no-docker        Skip Docker service management
  --verbose          Enable verbose logging
  --help             Show help

npx astra chat

Open an interactive CLI REPL connected to a running Astra gateway.

bash
npx astra chat [options]

Options:
  --url <url>            Gateway URL (default: http://localhost:3000)
  --agent <id>           Start with a specific agent
  --session <id>         Resume a specific session
  --json                 Output responses as JSON instead of rendered markdown
  --prompt <text>        Send a single prompt and exit (non-interactive)
  --help                 Show help

Examples:
  npx astra chat
  npx astra chat --agent research-agent
  npx astra chat --prompt "List all open issues" --json

npx astra stop

Stop the Docker containers managed by Astra. Data volumes are preserved.

bash
npx astra stop [options]

Options:
  --remove-volumes   Also remove data volumes (destructive — deletes all data)
  --help             Show help

npx astra doctor

Run the diagnostic suite and report health status across 12 checks in 6 categories.

bash
npx astra doctor [options]

Options:
  --url <url>    Gateway URL to check (default: http://localhost:3000)
  --json         Output results as JSON
  --verbose      Show details for passing checks too
  --help         Show help

Categories checked:
  connectivity  PostgreSQL, Typesense, gateway HTTP
  config        Required env vars, JWT secret strength
  migrations    Schema version, pending migrations
  agents        Agent health, paused agents, failure counts
  providers     Provider key validation, test inference call
  memory        pgvector extension, Typesense collection health

npx astra costs

Display the cost and usage dashboard in the terminal.

bash
npx astra costs [options]

Options:
  --url <url>        Gateway URL (default: http://localhost:3000)
  --period <period>  Time period: hour, day, week, month (default: day)
  --agent <id>       Filter to a specific agent
  --json             Output data as JSON instead of table
  --help             Show help

In-REPL slash commands

These commands are available inside the interactive CLI REPL:

CommandDescription
/helpShow all available commands
/agentShow the currently active agent
/agentsList all available agents with their model info
/switch <id>Switch to a different agent by ID
/resetClear the current session conversation history
/sessionShow the current session ID
/memory <query>Search memory and display top results
/usageShow token and cost usage for this session
/debugToggle debug mode (shows tool calls and context info)
/exitExit the REPL (also Ctrl+C or Ctrl+D)