Skip to main content
The agtos CLI provides a text-based interface for managing the agtOS system. It communicates with the running server via the REST API on the health port (default 4102).

Installation

Global Options

Commands

agtos start

Start the agtOS server. Spawns the server as a child process, monitors startup, and reports when the health endpoint is ready.
On first run, the CLI checks for configuration in this order:
  1. Encrypted credentials at ~/.agtos/credentials.json
  2. Environment variables (ANTHROPIC_API_KEY, OPENAI_API_KEY)
  3. .env.local in the current directory
If none are found, it guides you to run agtos setup first. Before starting, the CLI checks for port conflicts on all three ports (3000, 4100, 4102) and reports which process holds a conflicting port. Startup progress is displayed in real-time with per-service status:
Startup timeout: 30 seconds. The server process receives forwarded SIGINT/SIGTERM signals for graceful shutdown.

agtos setup

Interactive first-run configuration wizard. Checks prerequisites, prompts for API keys, validates credentials against the actual provider API, configures model slots, and stores encrypted credentials.
The wizard performs these steps:
  1. Node.js version check — requires 22+ (exits if older)
  2. Docker check — optional, shows running status
  3. Ollama check — optional, shows installed status
  4. Anthropic API key — prompts for sk-ant-api03-... key from console.anthropic.com. Validates against the Anthropic API. Offers retry on failure. Press Enter to skip.
  5. OpenAI API key — optional, prompts for sk-... key from platform.openai.com. Validates against the OpenAI API.
  6. Model slot configuration — configures the chat slot (required) with provider and model selection, plus an optional reasoning slot for complex tasks. Providers: claude, openai, ollama.
  7. Encrypt and store — saves credentials to ~/.agtos/credentials.json (AES-256-GCM encrypted) and slot configuration to ~/.agtos/config.json. If plaintext API keys exist in .env.local, they are migrated to the encrypted store and removed.
  8. Summary — shows configuration status and next steps

agtos status

Display system health and service status. Fetches data from the health and system info API endpoints.
Shows:
  • Overall system health (healthy/degraded)
  • Per-service status (Redis, STT, TTS, Ollama, Claude, MCP)
  • Uptime, Node.js version, memory usage
  • Port configuration

agtos chat

Interactive text chat with the agtOS agent. Uses the same agent reasoning loop as the voice pipeline.
The chat command verifies the server is reachable, then opens an interactive prompt that connects to POST /api/chat. Each message has a 30-second timeout. Session continuity is automatic — the server assigns a session ID on the first message and the CLI reuses it for subsequent messages. Responses show metadata: duration, reasoning steps (if > 1), and tool calls (if any). Errors don’t exit the loop — you can retry or continue chatting. In-chat commands:

agtos schedule

Manage scheduled tasks.
Create examples:

agtos memory

Search and manage agent memory.
The search subcommand queries the episodic and semantic memory system via GET /api/memory/search. Multi-word queries are supported — agtos memory search foo bar baz searches for "foo bar baz". Returns up to 20 results with relevance scores. The import subcommand scans for available external AI tool memories and imports them. Supported sources: Claude Code, Cursor, Windsurf, Aider, and GitHub Copilot. The maintain subcommand triggers an on-demand memory lint sweep via POST /api/memory/maintain. It prints a summary (conclusions examined, contradictions, stale, orphans, redundant, pruned, decayed, dangling sources) and exits with one of four codes: The sweep can take 30-60 seconds on large knowledge bases; the CLI allows up to 120 seconds before timing out.

agtos task

Run a background agent task. The task is processed through the same agent reasoning loop as chat, but designed for longer-running workloads (60-second timeout). Multi-word topics are supported.

agtos models

Manage sherpa-onnx ONNX model files for the local voice pipeline. This command operates directly on the local filesystem and does not require the server to be running.
Default model set (5 models needed for a full local voice pipeline):
  • silero-vad — Voice Activity Detection
  • moonshine-tiny-en-int8 — Fast English STT
  • sensevoice-int8 — Multilingual STT (zh, en, ja, ko)
  • kokoro-int8-multi-v1 — TTS (Kokoro)
  • zipformer-streaming-en-20m — Streaming STT for real-time partial results
Models are stored in ~/.agtos/models/ (configurable via AGTOS_MODEL_DIR).

agtos doctor

System health diagnostics. Checks all dependencies and reports pass/warn/fail status with actionable remediation hints.
Each check reports one of three statuses: pass (green), warn (yellow), or fail (red). Checks performed: The doctor finishes with a feature degradation summary showing which features are available based on the check results:
  • Text chat: Requires AI provider credentials
  • Voice: Requires speech models + AI provider
  • Scheduling: Requires Redis
  • Memory: Requires Redis
  • Local AI routing: Requires Ollama

Environment Variables

What’s next

Device Registry

Manage ESP32, browser, and CLI devices with per-device authentication.

Troubleshooting

Common issues and solutions for setup, voice, memory, and connectivity.