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 helpnpx 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" --jsonnpx 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 helpnpx 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 healthnpx 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 helpIn-REPL slash commands
These commands are available inside the interactive CLI REPL:
| Command | Description |
|---|---|
/help | Show all available commands |
/agent | Show the currently active agent |
/agents | List all available agents with their model info |
/switch <id> | Switch to a different agent by ID |
/reset | Clear the current session conversation history |
/session | Show the current session ID |
/memory <query> | Search memory and display top results |
/usage | Show token and cost usage for this session |
/debug | Toggle debug mode (shows tool calls and context info) |
/exit | Exit the REPL (also Ctrl+C or Ctrl+D) |