Overview
The GAIA CLI provides commands for managing your GAIA instance. All commands are interactive and run in your terminal.Make sure you’ve installed the CLI globally so you can use the
gaia command.Quick Reference
All Commands
| Command | Description |
|---|---|
gaia init | Full setup from scratch — clone repo, install tools, configure env |
gaia setup | Configure an existing repository |
gaia start | Start all services (auto-detects mode) |
gaia stop | Stop all services gracefully |
gaia status | Check health and latency of all services |
gaia --version | Display the current CLI version |
gaia --help | Show help and available commands |
gaia init
Complete first-time setup. Clones the repository, installs tools, configures environment variables, and optionally starts services.
| Flag | Description |
|---|---|
--branch <name> | Clone a specific branch instead of the default |
- Prerequisites - Checks Git, Docker, Mise (auto-installs Mise if missing)
- Port check - Detects conflicts and suggests alternatives
- Repository clone - Clones GAIA to your chosen directory
- Tool installation - Installs Node.js, Python, uv, Nx via Mise
- Environment setup - Choose setup mode and configure variables
- Project setup - Runs
mise setupfor dependencies and database seeding - Service startup - Optionally starts services (skipped if already running)
gaia setup
Configure an existing GAIA repository. Use when you need to set up or reconfigure environment variables and dependencies.
- Detect repo - Finds the GAIA repository root automatically
- Prerequisites - Checks Git, Docker, Mise
- Port check - Detects conflicts
- Environment setup - Interactive env var configuration
- Project setup - Installs dependencies via
mise setup - Service startup - Optionally starts services (skipped if already running)
The
setup command handles environment configuration automatically. For manual environment setup, see Environment Variables.Setup Modes
During environment setup, you choose a mode:Self-Host (Docker)
Self-Host (Docker)
Everything runs in Docker containers. Best for deployment and non-developers.
- Backend, worker, and all databases run as Docker services
- Web frontend is built and served via Next.js standalone
- Uses container hostnames for service communication
Developer Mode (Local)
Developer Mode (Local)
Database services run in Docker, API and web run locally. Best for contributing.
- Docker handles PostgreSQL, Redis, MongoDB, RabbitMQ, ChromaDB
- API server runs with hot reload on port 8000
- Web frontend runs with Turbopack on port 3000
Environment Variable Methods
Manual Setup
Manual Setup
Interactive prompts for each variable with descriptions, docs links, and defaults. Variables are auto-discovered from the codebase — no CLI updates needed when new variables are added.
Infisical
Infisical
Enter your Infisical credentials (token, project ID, machine identity) for centralized secret management.
gaia start
Start all GAIA services. Automatically detects selfhost vs developer mode from your .env configuration.
| Flag | Description |
|---|---|
--build | Rebuild Docker images before starting |
--pull | Pull latest base images before starting |
gaia start --build --pull
Self-Host mode:
- Runs
docker compose --profile all up -dfor the full backend stack - Builds and starts the web frontend
- Everything runs in Docker containers (background)
- Runs
mise devto start API and web in development mode- Logs are written to
dev-start.login the repo root — monitor withtail -f dev-start.log
- Logs are written to
- Databases run in Docker
- API and web run locally with hot reload
- Web: http://localhost:3000
- API: http://localhost:8000
- API Docs: http://localhost:8000/docs
gaia stop
Stop all running GAIA services gracefully.
- All Docker containers in the GAIA compose stack
- Local processes on ports 8000 (API) and 3000 (Web)
- Background workers and services
Your data is preserved — stopping services doesn’t delete databases or configurations.
gaia status
Check the health and latency of all GAIA services in real-time.
| Service | Port | Check |
|---|---|---|
| API | 8000 | HTTP GET /health |
| Web | 3000 | HTTP GET / |
| PostgreSQL | 5432 | TCP connection |
| Redis | 6379 | TCP connection |
| MongoDB | 27017 | TCP connection |
| RabbitMQ | 5672 | TCP connection |
| ChromaDB | 8080 | TCP connection |
- Press
rto refresh status manually - Status indicators: ✓ (healthy), ✗ (down), - (checking)
- Shows response time in milliseconds for each service
Port Conflict Handling
If required ports are in use, the CLI:- Detects which process is using the port
- Suggests an alternative port
- Automatically updates your
.envfiles with the alternative
infra/docker/.env inside your GAIA repo and persist across gaia start/gaia stop cycles — no need to re-run setup.
gaia status automatically uses the same overridden ports for health checks.
To change port assignments after setup, edit infra/docker/.env directly:
| Variable | Service |
|---|---|
API_HOST_PORT | API (default 8000) |
WEB_HOST_PORT | Web (default 3000) |
POSTGRES_HOST_PORT | PostgreSQL (default 5432) |
REDIS_HOST_PORT | Redis (default 6379) |
MONGO_HOST_PORT | MongoDB (default 27017) |
RABBITMQ_HOST_PORT | RabbitMQ (default 5672) |
CHROMA_HOST_PORT | ChromaDB (default 8080) |
Restart services after editing:
gaia stop && gaia startEnvironment Variable Auto-Discovery
The CLI discovers environment variables directly from the codebase at runtime:- API variables - Extracted from
apps/api/app/config/settings.pyandsettings_validator.pyusing Python AST parsing - Web variables - Parsed from
apps/web/.env
Upgrading
Updating GAIA
Pull the latest code in your GAIA repo directory:Updating the CLI
Reinstall globally using your package manager:Uninstalling
To fully remove GAIA from your machine:- Stop all services:
gaia stop - Delete the GAIA repository directory
- Remove CLI metadata:
rm -rf ~/.gaia - Uninstall the CLI:
Troubleshooting
command not found: gaia
command not found: gaia
The Add this to your shell config file (
gaia command requires global installation. Ensure the global bin directory is in your PATH:~/.bashrc, ~/.zshrc, etc.) to make it permanent.Raw mode is not supported
Raw mode is not supported
The CLI requires an interactive terminal. Don’t run it in the background, in a pipe, or in a non-TTY context.
Port conflicts not detected
Port conflicts not detected
Port detection uses
lsof which is available on macOS and most Linux distributions. Windows support requires WSL2.Environment variables not discovered
Environment variables not discovered
Verify these files exist in your repository:
apps/api/app/config/settings_validator.pyapps/web/.env
Python 3 not found
Python 3 not found
The CLI requires Python 3 to discover API environment variables. Install it via Mise:Or ensure
python3 is available on your PATH.Developer mode services not starting
Developer mode services not starting
Check
dev-start.log in your GAIA repo root for error output:
