🧠the-brain
Reference

CLI Reference

Complete command-line interface reference

Core Commands

the-brain init

the-brain init                          # Basic init
the-brain init --force                  # Overwrite existing config
the-brain init --project <name>         # Create project context
the-brain init --project <name> --work-dir <path> --label "My Project"
the-brain init --remote                 # Remote mode (generates auth token, binds 0.0.0.0)
the-brain init --db-path <path>         # Custom DB path

the-brain daemon

the-brain daemon start                  # Start background daemon
the-brain daemon stop                   # Stop daemon
the-brain daemon status                 # Check if running
the-brain daemon enable                 # Auto-launch via LaunchAgent (macOS)
the-brain daemon disable                # Disable auto-launch
the-brain daemon start --poll-interval 60000   # Custom poll interval (ms)

the-brain inspect

the-brain inspect --stats               # Memory counts, graph nodes
the-brain inspect --recent              # Latest interactions
the-brain inspect --graph               # High-weight graph nodes
the-brain inspect --search <query>      # Search graph nodes
the-brain inspect --memories            # All memories
the-brain inspect --memories deep       # Filter by layer (optional arg)
the-brain inspect --top correction      # Top nodes by type (concept|correction|preference|pattern|all)
the-brain inspect --sources             # Data source breakdown
the-brain inspect --project <name>      # Per project
the-brain inspect --global              # Global brain

the-brain consolidate

the-brain consolidate --now             # Immediate consolidation
the-brain consolidate --reprocess       # Re-run all INSTANT through SPM first
the-brain consolidate --layer selection # Target specific layer (selection|deep)
the-brain consolidate --project <name>  # Per project
the-brain consolidate --global          # Global brain

Training Commands

the-brain train

the-brain train                         # Train on all DEEP memories
the-brain train --dry-run               # Preview what would be trained
the-brain train --iterations 200        # Override training iterations
the-brain train --project <name>        # Per project
the-brain train --global                # Global brain

Full Pipeline (manual)

bun run apps/cli/src/full-pipeline.ts  # Harvest → curate → train (standalone)

Context & Wiki

the-brain context

the-brain context --prompt "fix auth bug"           # JSON output (default)
the-brain context --prompt "..." --format markdown   # Human-readable
the-brain context --project <name> --prompt "..."    # Per project
the-brain context --global --prompt "..."            # Global brain
the-brain context --query "React" --limit 20         # Filter + limit

the-brain wiki

the-brain wiki generate                 # Generate static wiki
the-brain wiki serve                    # Serve on http://localhost:3333
the-brain wiki open                     # Open in browser
the-brain wiki path                     # Show wiki directory path
the-brain wiki serve --port 4000        # Custom port
the-brain wiki generate --project <name>

the-brain docs

the-brain docs dev                      # Dev server (http://localhost:3001)
the-brain docs build                    # Static build → apps/docs/.next/
the-brain docs serve                    # Production server
the-brain docs dev --port 4000          # Custom port

Plugins & Backends

the-brain plugins

the-brain plugins list                  # List all loaded plugins
the-brain plugins list --status         # Show active/inactive/error status

the-brain backend

the-brain backend list                  # Show current backends
the-brain backend set --slot storage --backend libsql    # Switch storage
the-brain backend set --slot scheduler --backend cron    # Switch scheduler
the-brain backend unset --slot storage  # Revert to default

Extensions

the-brain ext

the-brain ext <command> [args...]       # Run registered extension command
the-brain ext                           # List available commands (empty = list)
// Extensions live in ~/.the-brain/extensions/*.ts
export default function (brain) {
  brain.registerCommand("hello", async () => console.log("Hello!"));
}

Network

the-brain health

the-brain health                        # Quick status
the-brain health --json                 # JSON output (machine-readable)
the-brain health --project <name>       # Per project
the-brain health --global               # Global brain

the-brain agent

the-brain agent                         # Push agent (polls IDE logs → server)
the-brain agent --once                  # Single poll cycle, then exit
the-brain agent --interval 30           # Custom poll interval (seconds)

the-brain mcp

the-brain mcp serve                     # stdio transport (for Claude Desktop)
the-brain mcp serve --sse               # SSE transport (for network clients)
the-brain mcp serve --sse --port 9422   # Custom SSE port
the-brain mcp serve --project <name>    # Target specific project
the-brain mcp serve --global            # Target global brain

Context Switching

the-brain switch-context

the-brain switch-context --project <name>   # Switch to project
the-brain switch-context --global           # Switch to global brain

the-brain dashboard

the-brain dashboard                    # Live TUI (2s refresh)
the-brain dashboard --project <name>   # Per project
the-brain dashboard --global           # Global brain
the-brain dashboard --interval 5       # Custom refresh interval (seconds)

On this page