Skip to main content
Source Code: src/gaia/cli.py
GAIA provides a comprehensive command-line interface (CLI) for interacting with AI models and agents. The CLI allows you to query models directly, manage chat sessions, and access various utilities without writing code.

Platform Support

Windows 11

Full GUI and CLI support

Linux

Full GUI and CLI support via source installation (Ubuntu/Debian)

Quick Start

  1. Follow the Quickstart to install GAIA
  2. Open PowerShell and run gaia to launch the Agent UI, or gaia --cli for terminal chat
  3. GAIA automatically starts Lemonade Server when needed, or start manually:

Top-Level Flags

Running gaia with no subcommand launches the Agent UI by default:
Examples:
gaia chat --ui continues to work as an alias. The Agent UI requires an AMD Ryzen AI Max (Strix Halo) or an AMD Radeon GPU with ≥ 24 GB VRAM. If your device is not supported, a dismissible warning banner will appear in the UI.

Agent step limit

Agents stop after a maximum number of reasoning/tool steps. The default is 50, applied consistently across the CLI, the Agent UI, and background runs.
  • Per-invocation: pass --max-steps <n> to any agent command (e.g. gaia browse --max-steps 80). gaia blender uses --steps <n>.
  • Fleet-wide: set the GAIA_AGENT_MAX_STEPS environment variable to change the default for every agent at once, without per-command flags.
A few agents intentionally override the default (e.g. the Code agent uses 100 for multi-file generation). An invalid GAIA_AGENT_MAX_STEPS value (non-integer or ≤ 0) fails fast with an actionable error rather than silently capping agents.

Per-tool execution timeout

Each tool call is bounded so a hung tool (e.g. a stuck connector or network request) surfaces an actionable error instead of leaving the agent — and the UI — stuck indefinitely. The default is 180 seconds per tool.
  • Fleet-wide: set GAIA_AGENT_TOOL_TIMEOUT (seconds) to change the default for every tool at once.
Tools that legitimately run longer opt out in code via @tool(timeout=...) — for example image generation, which may need to download a model on first use. An invalid GAIA_AGENT_TOOL_TIMEOUT value (non-numeric or ≤ 0) fails fast with an actionable error rather than silently removing the guard.

Initialization

Init Command

New users start here! The gaia init command is the easiest way to get GAIA running.
Initialize GAIA with a single command: installs Lemonade Server and downloads required models.
Options: Available Profiles: The --profile flag accepts one of the following values (see src/gaia/cli.py for the canonical choices list):
The talk, blender, jira, and docker agents all rely on the chat profile — there is no dedicated profile for each. Run gaia init --profile chat (or all) to prepare their dependencies.
gaia llm quick queries use the global default model (Gemma-4-E4B-it-GGUF).
Examples:
What It Does: GAIA works with Lemonade Server in two modes:
  • Local — Lemonade runs on the same machine (default)
  • Remote — Lemonade runs on another machine; enable with --remote or by setting LEMONADE_BASE_URL
  1. Checks Lemonade Server - Detects if installed and verifies version compatibility
  2. Installs/Upgrades Lemonade - Downloads and installs from GitHub releases (Windows/Linux only). Automatically uninstalls old version if version mismatch detected.
  3. Starts Server - Ensures Lemonade server is running, prompts to start if not
  4. Downloads Models - Pulls required models for the selected profile
  5. Verifies Setup - Tests each model with inference to detect corrupted downloads
Platform Support: Automatic installation supports Windows (MSI) and Linux (DEB) only. macOS users should install Lemonade Server manually from lemonade-server.ai.
Automatic Upgrade: If your installed Lemonade version doesn’t match the expected version, gaia init will offer to automatically uninstall the old version and install the correct one.
Corrupted Model Detection: gaia init verifies each model with a quick inference test. If a model fails verification (e.g., corrupted download), you’ll see instructions to manually delete and re-download it, or use gaia init --force-models to force re-download all models.

Install Command

Install individual GAIA components.
Options: Examples:
If a different version of Lemonade is already installed, you’ll be prompted to uninstall first.

Uninstall Command

Tiered cleanup of GAIA components. By default, the OS-native uninstall (Add or Remove Programs, drag to Trash, apt remove) only removes the app — user data in ~/.gaia/ is preserved. This command lets you escalate cleanup as far as you want.
Options: Examples:
--purge permanently deletes your chat history, uploaded documents, and configuration. Use --dry-run first to preview what will be removed.

Kill Command

Stop running GAIA services.
Options: Examples:
On Windows, --lemonade also kills orphaned llama-server.exe and lemonade-tray.exe processes.

Agent Command

Author, version, validate, and share GAIA agents.

Developer workflow: init, version, test

Scaffold a new agent package, bump its version, and run the quality gates that publishing requires. The scaffold mirrors the canonical hub package layout (hub/agents/python/summarize/).
init scaffolds a package directory named after <name>:
  • Python: gaia-agent.yaml, pyproject.toml (with the gaia.agent entry point), a gaia_agent_<id>/ package (__init__.py + agent.py skeleton), tests/test_agent.py, and README.md.
  • C++: gaia-agent.yaml, CMakeLists.txt, src/agent.cpp, tests/, and README.md.
version bumps the SemVer in gaia-agent.yaml and keeps pyproject.toml / __init__.py in sync. test runs quality gates in two modes: The publish workflow requires --lint to pass; --live is recommended but not enforced. Examples:

Lifecycle: configure, health, status

Manage an installed agent: set per-agent configuration, verify it loads, and inspect its state. Configuration is persisted under ~/.gaia/agents/<id>/config.json and survives restarts.
configure writes per-agent settings (e.g. a preferred model). --set values are JSON-decoded when possible (--set temperature=0.2 stores a number, --set verbose=true a boolean), otherwise kept as strings. Settings merge into the existing config by default; pass --replace to overwrite it wholesale, or --show to print the current config without changing it. health verifies that an installed agent actually loads — its registration resolves and its entry point imports. It reports one of healthy, degraded (loads but something optional is off, e.g. a corrupt config), error (a required piece fails to load), or not_installed, and exits non-zero for error / not_installed so scripts can gate on it. status aggregates installed version, health, config summary, and source for one agent — or every discovered agent when <id> is omitted. Examples:

Distribution: pack, publish, login

Build a distributable wheel from a Python agent package, then dual-publish it to the Agent Hub (R2, the source for the Hub UI) and PyPI (the source for pip install).
pack runs python -m build --wheel against the package’s pyproject.toml, writing gaia_agent_<id>-<version>-py3-none-any.whl to dist/ and printing its SHA-256. Python agents only — native (C++) agents ship a CMake-built binary, not a wheel. publish packs the wheel and uploads it to both targets. R2 receives a multipart POST (gaia-agent.yaml + wheel) authenticated with a Bearer token; PyPI receives a twine upload authenticated with an API token. Both enforce version immutability — bump the version with gaia agent version before re-publishing. login stores publisher tokens in your OS keyring. Tokens may also be supplied via the GAIA_HUB_TOKEN and PYPI_TOKEN environment variables (useful in CI), which take precedence over the keyring. The packaging toolchain (build, twine) ships in the publish extra:
Examples:
Installing a published agent
The two publish targets back two install paths, and both register the agent the same way — via the gaia.agent entry point, so the registry discovers it automatically:
From PyPI (pip)
The Hub (R2) path is the Agent UI’s discover/install panel, which downloads the wheel from R2 into ~/.gaia/agents/<id>/ (POST /api/agents/install, backed by gaia.hub.installer). Use it when browsing the Hub UI; use pip install for scripted or headless setups.
Automated PyPI publishing (CI)
.github/workflows/publish_agents.yml builds every production agent wheel and publishes it to PyPI on a version tag (v*). Its matrix is derived from the agents extra in setup.py (via util/list_agent_packages.py), so adding an agent there is all it takes to start publishing it. The workflow uploads with pypa/gh-action-pypi-publish using the PYPI_API_TOKEN secret and skip-existing: true, so an unchanged agent version is a no-op rather than an error — PyPI enforces version immutability natively.

Sharing: export, import

Export every custom agent installed under ~/.gaia/agents/ into a single .zip bundle, and import a bundle produced on another machine.
Export options: Import options: Examples:
Exported bundles contain your agent source files as-is. Any API keys or credentials present in agent.py will be included. Review bundles before sharing.
Importing a bundle runs third-party Python code on your machine. gaia agent import shows the agent IDs in the bundle and requires explicit y/yes confirmation (or --yes) before proceeding.

Core Commands

LLM Direct Query

The fastest way to interact with AI models - no server management required.
Options: Examples:
The lemonade server must be running. If not available, the command will provide instructions on how to start it.

Chat Command

Start an interactive conversation or send a single message with conversation history.
Modes:
  • No message: Starts interactive chat session
  • Message provided: Sends single message and exits
Options: Examples:
Interactive Commands: During a chat session, use these special commands:

Specialized Agent Commands

Use focused agent commands when you want a smaller tool surface than the full chat agent.
Options: Examples:

Prompt Command

Send a single prompt to a GAIA agent.
Options: Examples:

Specialized Agents

Code Agent

Code Development

AI-powered code generation, analysis, and linting for Python/TypeScript
The Code Agent requires extended context. Start Lemonade with:
Features:
  • Intelligent Language Detection (Python/TypeScript)
  • Code Generation (functions, classes, unit tests)
  • Autonomous Workflow (planning → implementation → testing → verification)
  • Automatic Test Generation
  • Iterative Error Correction
  • Code Analysis with AST
  • Linting & Formatting
Quick Examples: Routing detects “Express” and uses TypeScript:
Routing detects “Django” and uses Python:
Routing detects “React” and uses TypeScript frontend:
→ Full Code Agent Documentation

Code Index

gaia-code index builds and queries a local FAISS-backed semantic index over a repository. Embeddings run on AMD NPU/GPU through Lemonade Server. Requires the [rag] extras.
Common flags at the index level: --repo, --max-files, --model, --base-url, --no-lemonade-check, --use-claude, --use-chatgpt. → Full Code Index Documentation

Blender Agent

3D Scene Creation

Natural language 3D modeling and scene manipulation
Features:
  • Natural Language 3D Modeling
  • Interactive Planning
  • Object Management
  • Material Assignment
  • MCP Integration
Options: Examples: Interactive Blender mode:
Create specific objects:
Run built-in examples:
→ Full Blender Agent Documentation

Email Command

Email Triage

Read, organize, and reply to Gmail with all email content processed locally on your machine.
Options: Setup: requires the Google connector. Run gaia connectors connect google first; you’ll be asked to grant Gmail and Calendar scopes. Privacy: all email body inference runs locally on Lemonade — the agent rejects any non-local LLM endpoint at startup. → Full Email Triage Agent Documentation

SD Command

Image Generation

Generate images using Stable Diffusion on Ryzen AI
Options: Examples: Fast, good-quality generation with the default (SDXL-Turbo, ~17s):
Even faster (lower quality) with SD-Turbo (~13s):
Photorealistic with SDXL-Base-1.0 (slow, ~9min):
For automation (no prompts):
Interactive mode:
→ Full Image Generation Documentation

Talk Command

Voice Interaction

Speech-to-speech conversation with optional document Q&A
Options: Examples:
→ Full Voice Interaction Guide

Jira Command

Jira / Atlassian

Natural-language interface for Jira, Confluence, and Compass using your Atlassian credentials (REST API).
Options: → Full Jira Guide

Docker Command

Docker

Natural-language interface for Docker containerization.
Options: → Full Docker Guide

Summarize Command

Summarize meeting transcripts, emails, and PDFs.
Options:

Telegram Command

Telegram Adapter

Bridge a Telegram bot to GAIA so you can chat with your agents from Telegram.
Subcommands & options: → Telegram Adapter Guide

API Server

API Server

OpenAI-compatible REST API for VSCode and IDE integrations

Quick Start

  1. Start Lemonade with extended context:
  1. Start GAIA API server:
  1. Test the server:

Commands

Options:
  • --host - Server host (default: localhost)
  • --port - Server port (default: 8080).
    The gaia mcp docker bridge defaults to the same port — run them on different ports if you need both.
  • --debug - Enable debug logging
  • --show-prompts - Log the prompts sent to the LLM for every request (useful for debugging)
  • --streaming - Stream tokens to clients via SSE (OpenAI-style)
  • --step-through - Pause between agent steps for manual inspection (development aid)
Examples:Foreground:
With debug logging:
Custom host/port:
Streaming mode with prompt logging:
→ Full API Server Documentation

MCP Client

MCP Client

Connect GAIA agents to external MCP servers
Configure MCP servers that your agents can connect to. Servers are saved to ~/.gaia/mcp_servers.json by default, or to a custom config file using --config.

Commands

Managing MCP servers (add / remove)

gaia mcp add and gaia mcp remove were removed in #977 — MCP servers are now configured through the connectors framework. Run gaia connectors --help for the current commands. gaia mcp list (below) still lists configured servers.

gaia mcp list

List all configured MCP servers.
Options:
  • --config PATH - Custom config file path (default: ~/.gaia/mcp_servers.json)
Example:

gaia mcp tools

List tools available from a configured MCP server.
Arguments:
  • <server-name> - Name of the server to query
Options:
  • --config PATH - Custom config file path (default: ~/.gaia/mcp_servers.json)
Example:

gaia mcp test-client

Test connection to a configured MCP server.
Arguments:
  • <server-name> - Name of the server to test
Options:
  • --config PATH - Custom config file path (default: ~/.gaia/mcp_servers.json)
Example:
→ Full MCP Client Guide

MCP Bridge

MCP Bridge

Expose GAIA agents as MCP servers
The MCP Bridge allows other applications to use GAIA agents as MCP servers.

Quick Start

Install MCP support:
Start MCP bridge:
Test basic functionality:

Commands

gaia mcp start options

gaia mcp test options

gaia mcp agent

Pass a natural-language request and, optionally, a --domain (e.g. jira, docker) and free-form --context string to steer the orchestrator.

gaia mcp docker options

--port defaults to 8080.
This is the same default as gaia api start — run them on different ports if you need both alive at once.
→ Full MCP Integration Guide

Connectors

Connectors

OAuth providers, MCP-server connectors, and per-agent scope grants
Manage external connectors (OAuth providers like Google/GitHub, MCP servers, API tokens) and control which agents may use them. Configure a connector once, then grant individual agents the scopes they need.
Subcommands: Examples:
→ Connectors Guide · → Connectors SDK

Configuration

GAIA keeps a small persistent config at ~/.gaia/config.json (override the location with the GAIA_CONFIG_DIR / GAIA_CONFIG_FILE environment variables). Use it to set a default model once instead of passing --model on every command.

Default model precedence

For gaia chat, gaia llm, and gaia prompt, the model is resolved highest-wins:
  1. An explicit --model <id> flag
  2. default_model from ~/.gaia/config.json
  3. The command’s built-in default (DEFAULT_MODEL_NAME)
So gaia config set default_model <id> lets you skip --model entirely, while --model still overrides it for a single run. For gaia chat, passing an explicit --device selects a device-specific model and takes precedence over the config default.
A missing config file is fine — GAIA falls back to built-in defaults. A corrupt config file (invalid JSON) fails loudly with the file path and how to recover, rather than silently reverting to defaults.

Using a custom config file

Point GAIA at a config file anywhere on disk — handy for per-project configs or keeping work and personal defaults separate. Two equivalent ways:
When both are given, --config wins over GAIA_CONFIG_FILE, which wins over the default ~/.gaia/config.json.

Model Management

Download Command

Download all models required for GAIA agents with streaming progress.
Options: Available Agents: chat, code, talk, rag, blender, jira, docker, vlm, minimal, mcp Examples: List all models:
List models for specific agent:
Download all models:
Download for specific agent:
Example Output:

Pull Command

To download individual models, use the Lemonade Server CLI directly:
Use lemonade-server list to see all available models and their download status.

Evaluation Commands

Evaluation Framework

Systematic testing, benchmarking, and model comparison
Tools for:
  • Agent eval benchmark (scenario-based, end-to-end)
  • Auto-fixing failures with Claude Code
  • Report generation
  • Performance-log visualization
Quick Examples: Run the agent eval benchmark:
Generate a report:
Visualize llama.cpp performance logs:
→ Full Evaluation Guide

Agent Eval

Agent Eval Benchmark

Scenario-based end-to-end testing of the GAIA Agent UI
Run automated multi-turn conversation tests against the live Agent UI. The eval agent (Claude Code) simulates user personas, drives conversations via MCP, and judges every response across 7 scoring dimensions.
Options: Examples:
The eval agent requires Claude Code CLI (claude command), an Anthropic API key, and the Agent UI backend running. See the Agent Eval Guide for full setup instructions.
→ Full Agent Eval Guide · → Scenario Authoring · → CI/CD Integration

Email Throughput Benchmark

Measure end-to-end email-triage throughput (tokens/sec), time-to-first-token, and pipeline latency for an on-device model. Direct-drives the email agent over the committed synthetic corpus and harvests metrics from the agent’s per-step stats. The committed bar is ≥10 tok/s (snappy-UX stretch ~30 tok/s); the benchmark is non-gating — a miss is reported, not failed.
Options:
Runs from a GAIA repo checkout (it drives the synthetic corpus in tests/fixtures/email/) and needs Lemonade serving the target model. Run at most one gaia eval process at a time against a single Lemonade server.

Performance Visualization

Plot llama.cpp server performance metrics from one or more log files. Plots are saved as images; pass --show to also display them interactively.
Options: Examples:

Memory

Agent Memory Guide

Persistent second brain — remembers facts, preferences, and workflows across sessions
Manage agent memory: run day-zero onboarding and view memory statistics.

Commands

Show aggregate memory statistics.
Output includes:
  • Knowledge entries by category (fact, preference, error, skill) and context
  • Conversation count and session history
  • Tool call success rates and error counts
  • Upcoming and overdue time-sensitive items
  • Database size
→ Full Memory Guide · → Memory SDK Reference

Schedule

Run a prompt on a recurring cron schedule and route its output to a sink. Schedules are stored in ~/.gaia/schedules.toml (hand-editable). The daemon action runs a long-lived scheduler that fires each enabled schedule when due.

Subcommands

add Options

Examples:

Sinks

A sink decides where each scheduled run’s output goes. Set it with --sink on add (default stdout): Telegram example:
--skill is not yet implemented — running a skill-backed schedule raises an error pending the skill format (#888). Use --prompt for now.

Utility Commands

Stats Command

View performance statistics from the most recent model run.

Test Commands

Run various tests for development and troubleshooting.
Test Types:
  • tts-preprocessing - Test TTS text preprocessing
  • tts-streaming - Test TTS streaming playback
  • tts-audio-file - Test TTS audio file generation
Options:
  • --test-text - Text to use for TTS tests
  • --output-audio-file - Output file path (default: output.wav)
Examples:Test preprocessing:
Test streaming:
Generate audio file:

YouTube Utilities

Download transcripts from YouTube videos.
Options:
  • --download-transcript - YouTube URL to download transcript from
  • --output-path - Output file path (defaults to transcript_.txt)
Example:

Daemon Command

Manage the headless custody daemon — the always-on, single-instance background process that later Agent UI v2 phases (sidecar supervision, /host/v1/* custody, the model-slot broker, the scheduler clock) mount into. This Phase-1 skeleton provides single-instance identity, client-token auth, and lifecycle control. Requires the daemon extras (fastapi/uvicorn/psutil) — install with pip install "amd-gaia[ui]" (or [api]/[dev]). Running it on a base install fails loudly with that instruction.

Cache Command

Inspect or clear GAIA’s on-disk caches (document-Q7 metadata, chat history, context7 library docs, etc.). Caches live under ~/.gaia/cache/ (Windows: %LOCALAPPDATA%/gaia/cache/).
Actions: Flags for clear: Examples:

Knowledge Command

Web research via Tavily, with SQLite result caching, a per-session credit budget, and an automatic keyless DuckDuckGo fallback when the mcp-tavily connector isn’t configured. See the Tavily connector.
Actions: Options: Examples:
search automatically degrades to DuckDuckGo when the mcp-tavily connector isn’t configured; extract requires Tavily and raises an actionable error otherwise. Configure the connector with gaia connectors configure mcp-tavily --set TAVILY_API_KEY=tvly-....

Kill Command

Terminate processes running on specific ports.
Options: Examples:
This command will:
  • Find the process ID (PID) bound to the specified port
  • Forcefully terminate that process
  • Provide feedback about success or failure

Diagnostics Command

Bundle system info and logs into a tarball for bug reports.
Options: Examples:
The bundle includes:
  • System info snapshot (uname -a, distro, relevant env vars, all TCP listeners via ss -tlnp)
  • State files from ~/.gaia/ (config, session data — no chat content)
  • Log files: ~/.gaia/gaia.log and ~/.gaia/electron-main.log (omitted with --no-logs)

Global Options

All commands support these global options:

Troubleshooting

If you get connection errors, ensure Lemonade server is running:
Check available system memory (16GB+ recommended)Verify model compatibility:
Pre-download models:
Install additional models: See Features Guide
List available devices:
Verify microphone permissions in Windows settingsTry different audio device indices if default doesn’t work
For optimal NPU performance:
  • Disable discrete GPUs in Device Manager
  • Ensure NPU drivers are up to date
  • Monitor system resources during execution
For more help, see:

See Also

Code Agent

Python/TypeScript development

Blender Agent

3D scene creation

Voice Interaction

Speech-to-speech conversation

API Server

OpenAI-compatible REST API

MCP Integration

Model Context Protocol

Evaluation Framework

Testing and benchmarking

Agent Memory

Persistent memory across sessions