Skip to content

CLI (astromeshctl)

astromeshctl is the command-line interface for inspecting and managing a running Astromesh daemon. It communicates with astromeshd via the REST API.

These flags apply to all commands:

FlagDefaultDescription
--host URLhttp://localhost:8000Address of the Astromesh daemon
--jsonfalseOutput in machine-readable JSON instead of human-friendly tables
--helpShow help for any command

Show daemon status including version, uptime, mode, and agent count.

$ astromeshctl status
Astromesh v0.10.0
Status: running
Mode: standalone
PID: 48291
Uptime: 2h 14m 32s
Agents: 3 loaded
Providers: 2 healthy, 0 degraded

Run health checks against the runtime, providers, and backends. Reports issues with actionable suggestions.

$ astromeshctl doctor
✓ Runtime healthy
✓ OpenAI healthy (avg latency: 420ms)
✓ Anthropic healthy (avg latency: 380ms)
✓ Redis healthy
✗ ChromaDB unreachable (connection refused on localhost:8000)
→ Check that ChromaDB is running: docker start chroma
3 healthy, 0 degraded, 1 failing

List all loaded agents with their status and configuration.

$ astromeshctl agents list
NAME MODEL ORCHESTRATION STATUS
assistant openai/gpt-4o react ready
researcher anthropic/claude plan_and_execute ready
support ollama/llama3 react ready

List all configured LLM providers and their health status.

$ astromeshctl providers list
PROVIDER MODEL STATUS LATENCY CIRCUIT
openai gpt-4o healthy 420ms closed
anthropic claude-sonnet healthy 380ms closed
ollama llama3 healthy 120ms closed

Validate configuration files without starting the daemon. Checks runtime.yaml and all agent YAML files for schema errors.

$ astromeshctl config validate
Validating /etc/astromesh/runtime.yaml ... ok
Validating agents/assistant.agent.yaml ... ok
Validating agents/researcher.agent.yaml ... ok
Validating agents/support.agent.yaml ... ok
All configuration files are valid.
$ astromeshctl config validate
Validating /etc/astromesh/runtime.yaml ... ok
Validating agents/broken.agent.yaml ... FAILED
→ spec.model.primary.provider: required field missing
→ spec.orchestration.pattern: unknown pattern "invalid"
1 error(s) found.
FlagDescription
--config PATHPath to configuration directory (uses same auto-detection as astromeshd if omitted)

List services enabled on this node.

$ astromeshctl services
SERVICE STATUS
api running
memory running
tools running
rag running
mesh disabled

List known peer nodes (mesh mode only).

$ astromeshctl peers list
NODE ADDRESS STATUS LAST SEEN
node-alpha 10.0.1.10:8000 alive 2s ago
node-beta 10.0.1.11:8000 alive 1s ago
node-gamma 10.0.1.12:8000 suspect 18s ago

Show cluster overview (mesh mode only).

$ astromeshctl mesh status
Cluster: astromesh-prod
Nodes: 3 total (2 alive, 1 suspect, 0 dead)
Leader: node-alpha
This node: node-beta
Gossip: converged

Show detailed node table with agent assignments and load (mesh mode only).

$ astromeshctl mesh nodes
NODE ROLE AGENTS ACTIVE REQS CPU MEM
node-alpha leader assistant,support 12 34% 1.2G
node-beta worker researcher 5 22% 0.8G
node-gamma worker assistant 0 8% 0.6G

Gracefully leave the cluster. Drains active requests and notifies peers before departing.

$ astromeshctl mesh leave
Draining 3 active requests...
Notifying peers...
Left cluster successfully.
FlagDescription
--forceLeave immediately without draining requests

Interactive configuration wizard that generates runtime.yaml and agent templates.

$ astromeshctl init
Welcome to Astromesh setup!
? Select providers to configure:
[x] OpenAI
[ ] Anthropic
[x] Ollama (local)
? Default orchestration pattern: react
? Enable mesh mode? No
Configuration written to ./config/
→ runtime.yaml
→ agents/assistant.agent.yaml
Run 'astromeshd' to start.
FlagDescription
--devGenerate development-friendly defaults (in-memory backends, debug logging, Ollama provider)
--non-interactiveUse all defaults without prompting. Suitable for CI/scripts
--output PATHDirectory to write config files. Default: ./config/

Generate a new agent YAML configuration file.

$ astromeshctl new agent my-bot --provider openai --model gpt-4o --orchestration plan_and_execute
╭─ astromesh new agent ────────────────────────────╮
│ Created agent: ./config/agents/my-bot.agent.yaml │
│ │
│ Provider: openai │
│ Model: gpt-4o │
│ Pattern: plan_and_execute │
╰──────────────────────────────────────────────────╯
FlagDefaultDescription
--providerollamaLLM provider
--modelllama3.1:8bModel name
--orchestrationreactOrchestration pattern
--toolsTools to include (repeatable)
--output-dir./config/agentsOutput directory
--forcefalseOverwrite existing file

Generate a new workflow YAML configuration file.

$ astromeshctl new workflow data-pipeline
╭─ astromesh new workflow ─────────────────────────────────────────╮
│ Created workflow: ./config/workflows/data-pipeline.workflow.yaml │
╰──────────────────────────────────────────────────────────────────╯
FlagDefaultDescription
--output-dir./config/workflowsOutput directory
--forcefalseOverwrite existing file

Scaffold a new custom tool as a Python file. The name should be in snake_case.

$ astromeshctl new tool web_scraper --description "Scrape web pages"
╭─ astromesh new tool ─────────────────────────╮
│ Created tool: ./web_scraper.py │
│ │
│ Class: WebScraperTool │
│ Description: Scrape web pages │
╰──────────────────────────────────────────────╯
FlagDefaultDescription
--descriptionA custom toolTool description
--output-dir.Output directory
--forcefalseOverwrite existing file

Execute an agent with a query via the local API server.

$ astromeshctl run support-agent "What are your business hours?"
╭─ support-agent ──────────────────────────────────────────╮
│ Our business hours are Monday through Friday, 9 AM to │
│ 5 PM EST. We're closed on weekends and major holidays. │
╰── trace: abc-123 | tokens: 342 ──────────────────────────╯
FlagDefaultDescription
--sessionauto-generated UUIDSession ID for multi-turn conversations
--jsonfalseOutput raw JSON response
--timeout60.0Request timeout in seconds
--workflowfalseRun as workflow instead of agent (Sub-project 4)
--inputWorkflow input data as JSON string

Start the Astromesh development server with hot-reload. Watches astromesh/ and config/ directories for changes and automatically restarts.

$ astromeshctl dev
╭─ astromesh dev ──────────────────────────────╮
│ Astromesh Dev Server │
│ │
│ Host: 0.0.0.0 │
│ Port: 8000 │
│ Config: ./config │
│ Reload: enabled │
╰──────────────────────────────────────────────╯
FlagDefaultDescription
--host0.0.0.0Bind host
--port8000Bind port
--config./configConfig directory
--no-openfalseSkip opening browser

List recent execution traces for an agent.

$ astromeshctl traces list support-agent --last 5
FlagDefaultDescription
--last10Number of recent traces to show
--jsonfalseOutput raw JSON

Show detailed trace information with a span tree visualization.

$ astromeshctl trace abc-123-def-456
FlagDefaultDescription
--jsonfalseOutput raw JSON

Show aggregated runtime metrics for all agents or a specific agent.

$ astromeshctl metrics --agent support-agent
FlagDefaultDescription
--agentFilter by agent name
--jsonfalseOutput raw JSON

Show a cost summary across all agents and providers.

$ astromeshctl cost
FlagDefaultDescription
--jsonfalseOutput raw JSON

List all available built-in tools registered in the runtime.

$ astromeshctl tools list
FlagDefaultDescription
--jsonfalseOutput raw JSON

Test a tool in isolation by calling it with JSON arguments.

$ astromeshctl tools test get_current_time '{}'
Tool: get_current_time
Status: ok
Result:
{
"datetime": "2026-03-10T14:23:45Z"
}
FlagDefaultDescription
--jsonfalseOutput raw JSON

The second argument is a JSON string with the tool’s input arguments. Use '{}' for tools that take no arguments.


Validate all YAML configuration files under the project config directory. Checks for valid YAML syntax, required fields (apiVersion, kind, metadata.name), and correct kind values based on file naming conventions.

$ astromeshctl validate
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓
┃ File ┃ Status ┃ Message ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩
│ config/agents/support.agent.yaml │ valid │ OK │
│ config/agents/hello.agent.yaml │ valid │ OK │
│ config/runtime.yaml │ valid │ OK │
└───────────────────────────────────┴────────┴─────────┘
All files valid: 3 file(s) checked
FlagDefaultDescription
--path./configPath to config directory

Ask the Astromesh Copilot a question. The copilot is a built-in agent (astromesh-copilot) that can validate configs, explain traces, suggest tools, and help debug provider issues.

$ astromeshctl ask "What orchestration pattern should I use for a research agent?"
╭─ Astromesh Copilot ──────────────────────────────────────╮
│ For a research agent, I'd recommend the │
│ `plan_and_execute` pattern. It first generates a plan │
│ of steps, then executes each step sequentially... │
╰── trace: cop-789 ────────────────────────────────────────╯
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

Example with context file:

Terminal window
astromeshctl ask "Is this agent config correct?" --context config/agents/hello.agent.yaml

The copilot will read the file and include its contents as context when answering your question.