Skip to content

CLI Reference

astromeshctl is the command-line interface for managing an Astromesh Node. It communicates with the running astromeshd daemon over HTTP (default: http://localhost:8000).

FlagDefaultDescription
--hostlocalhostDaemon host
--port8000Daemon port
--jsonfalseOutput in JSON format (all commands)
--configplatform defaultPath to config directory
--helpShow help
--versionShow version

Print version information.

Terminal window
astromeshctl version

Output:

Astromesh Node v0.18.0
Daemon: /opt/astromesh/bin/astromeshd
CLI: /opt/astromesh/bin/astromeshctl
Python: 3.12.x
Platform: linux/amd64

Interactive configuration wizard. Generates runtime.yaml, providers.yaml, and a default agent.

Terminal window
sudo astromeshctl init [flags]
FlagDescription
--profile <name>Pre-select a profile (full, gateway, worker, inference, minimal, rag, edge)
--provider <name>Pre-select a provider (ollama, openai, anthropic, groq, gemini, onnx)
--model <name>Pre-select a model
--non-interactiveSkip prompts; use provided flags and defaults
--output <dir>Write config to a custom directory

Example:

Terminal window
sudo astromeshctl init --profile worker --provider openai --model gpt-4o --non-interactive

Display the current runtime status.

Terminal window
astromeshctl status [--json]

Output:

┌──────────────────────────────────────┐
│ Astromesh Status │
├──────────────┬───────────────────────┤
│ Status │ ● Running │
│ Version │ 0.18.0 │
│ Uptime │ 4h 12m 33s │
│ Profile │ full │
│ PID │ 4521 │
│ Agents │ 3 loaded │
│ Providers │ 2 healthy, 0 degraded │
│ Memory │ 156.0 MB │
└──────────────┴───────────────────────┘

JSON output:

{
"status": "running",
"version": "0.18.0",
"uptime_seconds": 15153,
"profile": "full",
"pid": 4521,
"agents_loaded": 3,
"providers": { "healthy": 2, "degraded": 0 },
"memory_mb": 156.0
}

Start the daemon service (delegates to the platform service manager).

Terminal window
sudo astromeshctl start

Stop the daemon service gracefully.

Terminal window
sudo astromeshctl stop

Restart the daemon service.

Terminal window
sudo astromeshctl restart

Reload configuration without restarting (sends SIGHUP on Linux/macOS).

Terminal window
sudo astromeshctl reload

Run a full health diagnostics check.

Terminal window
astromeshctl doctor [--json]

Output:

Astromesh Doctor
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
OK Daemon Running (PID 4521)
OK API Server Responding on :8000
OK Provider: ollama Connected (llama3.1:8b available)
OK Provider: openai Connected (gpt-4o available)
OK Memory: sqlite /var/lib/astromesh/memory/conversations.db
OK Config All files valid
Result: Healthy

Tail the daemon logs.

Terminal window
astromeshctl logs [flags]
FlagDefaultDescription
--follow / -ffalseFollow log output
--lines / -n50Number of lines to show
--levelallFilter by log level (debug, info, warning, error)

Example:

Terminal window
astromeshctl logs -f -n 100
astromeshctl logs --level error

Manage agents loaded by the daemon.

Terminal window
astromeshctl agents list [--json]

Output:

┌──────────────┬──────────────────────────┬──────────────────┬─────────┐
│ Name │ Description │ Model │ Pattern │
├──────────────┼──────────────────────────┼──────────────────┼─────────┤
│ default │ Default assistant │ ollama/llama3.1:8b │ react │
│ researcher │ Research assistant │ openai/gpt-4o │ react │
│ summarizer │ Document summarizer │ openai/gpt-4o │ pipeline│
└──────────────┴──────────────────────────┴──────────────────┴─────────┘
Terminal window
astromeshctl agents info default [--json]

Reload all agent definitions from disk (equivalent to astromeshctl reload):

Terminal window
sudo astromeshctl agents reload
Terminal window
astromeshctl providers list [--json]

Output:

┌─────────┬────────┬─────────────────────────┬──────────┐
│ Name │ Type │ Endpoint │ Status │
├─────────┼────────┼─────────────────────────┼──────────┤
│ ollama │ ollama │ http://localhost:11434 │ ● Healthy│
│ openai │ openai │ https://api.openai.com │ ● Healthy│
└─────────┴────────┴─────────────────────────┴──────────┘

Run health checks on all configured providers:

Terminal window
astromeshctl providers health [--json]

Validate configuration files without starting the daemon:

Terminal window
astromeshctl config validate [--config <dir>]

Output:

Validating /etc/astromesh/runtime.yaml ... OK
Validating /etc/astromesh/providers.yaml ... OK
Validating /etc/astromesh/agents/default.agent.yaml ... OK
All configuration files are valid.

Print the merged active configuration:

Terminal window
astromeshctl config show [--json]

Open the config directory in the system editor:

Terminal window
sudo astromeshctl config edit

Display memory backend usage:

Terminal window
astromeshctl memory stats [--json]

Clear conversational memory for a specific agent:

Terminal window
astromeshctl memory clear default
astromeshctl memory clear --all # Clear for all agents

List all registered tools:

Terminal window
astromeshctl tools list [--json]

All commands support --json for scripting and automation:

Terminal window
astromeshctl status --json | jq '.agents_loaded'
astromeshctl providers list --json | jq '.[] | select(.status == "healthy") | .name'