Skip to content

CLI Commands

Quick-reference for every command available in the Astromesh CLI tools.

The daemon process. Bootstraps the runtime, starts the API server, and manages the agent lifecycle.

CommandDescription
astromeshdStart the daemon with auto-detected configuration
astromeshd --config PATHStart with an explicit configuration directory
astromeshd --port PORTOverride the API server port (default: 8000)
astromeshd --host HOSTOverride the bind address (default: 0.0.0.0)
astromeshd --log-level LEVELSet logging level: debug, info, warning, error (default: info)
astromeshd --pid-file PATHCustom PID file location (default: /var/run/astromesh/astromeshd.pid)
astromeshd --workers NNumber of Uvicorn worker processes (default: 1)
Terminal window
# Development: debug logging, default config
astromeshd --log-level debug
# Production: explicit config, custom port
astromeshd --config /etc/astromesh --port 9000
# Multiple workers behind a load balancer
astromeshd --workers 4 --port 8000

For detailed daemon documentation, see Daemon (astromeshd).

The CLI client. Communicates with a running daemon via the REST API.

FlagDefaultDescription
--host URLhttp://localhost:8000Address of the Astromesh daemon to connect to
--jsonfalseOutput in machine-readable JSON format
--helpShow help for any command or subcommand
CommandFlagsDescription
astromeshctl statusShow daemon version, uptime, mode, PID, and agent count
astromeshctl doctorRun health checks on runtime, providers, and backends
CommandFlagsDescription
astromeshctl agents listList all loaded agents with model, orchestration pattern, and status
CommandFlagsDescription
astromeshctl providers listList configured providers with health status, latency, and circuit breaker state
CommandFlagsDescription
astromeshctl config validate--config PATHValidate runtime.yaml and agent YAML files without starting the daemon
astromeshctl init--dev, --non-interactive, --output PATHInteractive configuration wizard to generate runtime.yaml and agent templates
astromeshctl validate--path PATHValidate all project YAML configs (checks syntax, required fields, kind matching)

init flags:

FlagDescription
--devGenerate development defaults (in-memory backends, debug logging, Ollama)
--non-interactiveUse all defaults without prompting (for CI/scripts)
--output PATHDirectory to write config files (default: ./config/)

validate flags:

FlagDefaultDescription
--path./configPath to config directory to validate
CommandFlagsDescription
astromeshctl new agent <name>--provider, --model, --orchestration, --tools, --output-dir, --forceGenerate a new agent YAML configuration
astromeshctl new workflow <name>--output-dir, --forceGenerate a new workflow YAML configuration
astromeshctl new tool <name>--description, --output-dir, --forceScaffold a new custom tool Python file

new agent flags:

FlagDefaultDescription
--providerollamaLLM provider
--modelllama3.1:8bModel name
--orchestrationreactOrchestration pattern
--toolsTools to include (repeatable)
--output-dir./config/agentsOutput directory
--forcefalseOverwrite existing file

new workflow flags:

FlagDefaultDescription
--output-dir./config/workflowsOutput directory
--forcefalseOverwrite existing file

new tool flags:

FlagDefaultDescription
--descriptionA custom toolTool description
--output-dir.Output directory
--forcefalseOverwrite existing file
CommandFlagsDescription
astromeshctl run <agent> "query"--session, --json, --timeout, --workflow, --inputExecute an agent with a query
astromeshctl dev--host, --port, --config, --no-openStart the dev server with hot-reload

run flags:

FlagDefaultDescription
--sessionauto-generated UUIDSession ID for multi-turn conversations
--jsonfalseOutput raw JSON response
--timeout60.0Request timeout in seconds
--workflowfalseRun as workflow instead of agent
--inputWorkflow input data as JSON string

dev flags:

FlagDefaultDescription
--host0.0.0.0Bind host
--port8000Bind port
--config./configConfig directory
--no-openfalseSkip opening browser
CommandFlagsDescription
astromeshctl traces list <agent>--last, --jsonList recent traces for an agent
astromeshctl trace <trace_id>--jsonShow detailed trace with span tree
astromeshctl metrics--agent, --jsonShow aggregated runtime metrics
astromeshctl cost--jsonShow cost summary

traces list flags:

FlagDefaultDescription
--last10Number of recent traces to show
--jsonfalseOutput raw JSON
CommandFlagsDescription
astromeshctl tools list--jsonList all available built-in tools
astromeshctl tools test <name> '<args>'--jsonTest a tool in isolation with JSON arguments
CommandFlagsDescription
astromeshctl ask "question"--context, --dry-run, --session, --jsonAsk the built-in Astromesh Copilot

ask flags:

FlagDefaultDescription
--contextPath to a context file (must be under config/ or docs/, max 100KB)
--dry-runfalseRun in dry-run mode (no side effects)
--sessionauto-generated UUIDSession ID for multi-turn conversation
--jsonfalseOutput raw JSON
CommandFlagsDescription
astromeshctl servicesList services enabled on this node and their status

These commands require mesh mode to be enabled.

CommandFlagsDescription
astromeshctl peers listList known peer nodes with address, status, and last seen time
astromeshctl mesh statusShow cluster overview: node count, leader, alive/suspect/dead breakdown
astromeshctl mesh nodesDetailed node table with agent assignments, active requests, CPU, and memory
astromeshctl mesh leave--forceGracefully leave the cluster (drain requests, notify peers)

mesh leave flags:

FlagDescription
--forceLeave immediately without draining active requests
Terminal window
# Check if the daemon is running
astromeshctl status
# Run health checks
astromeshctl doctor
# Scaffold a new agent
astromeshctl new agent my-bot --provider openai --model gpt-4o
# Scaffold a workflow and a custom tool
astromeshctl new workflow data-pipeline
astromeshctl new tool web_scraper --description "Scrape web pages"
# Start the dev server with hot-reload
astromeshctl dev
# Run an agent from the CLI
astromeshctl run support-agent "What are your business hours?"
# Run an agent and get JSON output
astromeshctl run support-agent "Hello" --json
# Validate all config files
astromeshctl validate
# View recent traces for an agent
astromeshctl traces list support-agent --last 5
# Inspect a specific trace
astromeshctl trace abc-123-def-456
# View metrics and cost
astromeshctl metrics --agent support-agent
astromeshctl cost
# List and test tools
astromeshctl tools list
astromeshctl tools test get_current_time '{}'
# Ask the copilot for help
astromeshctl ask "What pattern should I use for a research agent?"
astromeshctl ask "Is this config valid?" --context config/agents/my-bot.agent.yaml
# List agents in JSON format
astromeshctl agents list --json
# Validate config before deploying
astromeshctl config validate --config /etc/astromesh
# Connect to a remote daemon
astromeshctl --host http://10.0.1.10:8000 status
# Check mesh cluster health
astromeshctl mesh status
# Generate dev config non-interactively
astromeshctl init --dev --non-interactive
# View detailed node info in mesh
astromeshctl mesh nodes --json
CodeMeaning
0Success
1General error (daemon unreachable, invalid arguments)
2Configuration validation failed
3Agent not found
4Mesh operation failed (not in mesh mode, node not found)