Skip to content

CLI Reference

scarecr0w12 edited this page Jun 24, 2026 · 11 revisions

CLI Reference

Complete reference for all cortex commands. Commands are organized into nested domain groups.

Command Tree

Command Description
agent Agent management, chat, and execution
agent chat Interactive streaming chat session (TUI)
agent tui Full-featured terminal UI with tool panel
agent exec <prompt> One-shot non-interactive agent execution
agent list List all registered agents
agent show <id> Show agent configuration details
agent create <name> Create a new agent
agent update <id> Update an existing agent
agent delete <id> Delete an agent
agent select <id> Set as default/active agent
agent inspect <id> Inspect agent identity (soul/user/memory)
agent clone <source> <name> Clone an existing agent
agent import <source> Import from URL or marketplace
agent sessions List recent chat sessions
agent eval Run agent evaluation suites
agent reflect Inspect consolidation patterns
agent lint Audit agent configs, tools, plugins, prompts
agent voice Manage voice mode
server HTTP server management
server start Start HTTP + WebSocket server with Web UI
server stop Stop background server
server restart Restart background server
sandbox Code execution sandbox
sandbox run <file> Execute a code file with optional LLM auto-fix
daemon Background process management
daemon start Start supervisor daemon in background
daemon stop Stop daemon processes
daemon restart Restart daemon processes
daemon run Run supervisor in foreground
daemon status Show daemon health
config Configuration management
config get <key> Read a dot-notation config key
config set <key> <value> Set a config value (JSON5 auto-parsed)
config unset <key> Remove a config key
config list Pretty-print full config (secrets redacted)
config validate Validate config against schema
db Database management
db migrate Initialize or migrate all databases
self Self-management
self update Check for and apply updates
setup Run the setup wizard
memory Search and manage memory
vault Encrypted credential vault
policy Security policy rules
soul Agent identity and personality templates
plugins Install and manage plugins
marketplace Browse plugin/agent marketplace
models List and configure LLM models
jobs Manage scheduled jobs
git Git workspace operations
github GitHub integration
mcp MCP server management
mcp chrome Manage Chrome Bridge browser automation
mcp a2a A2A Protocol agent card, skills, connections
mcp gateway MCP Gateway management
service Micro-service CRUD and system service install
service list List micro-services
service show <id> Show service details
service create <name> Create a new service
service update <id> Update service configuration
service delete <id> Delete a service
service start <name> Start a service
service stop <name> Stop a service
service install Install as system service
service uninstall Remove system service
node Manage distributed nodes
swarm Manage distributed agent swarm
channels Manage channel adapters
hooks Manage pipeline hooks
triggers Manage event triggers
workflow Workflow engine operations
import Import data from other platforms
qm Quartermaster tool orchestration learning
mqm Model Quartermaster (MQM) intelligence
eval Run agent evaluation suites
eval memory Run memory benchmark suite
projects Project management
desktop Desktop automation
login Authenticate with username+password or API token
logout Clear stored authentication
whoami Show current authenticated user and teams
users Manage instance users (list/create/disable/enable)
teams Manage teams (list/create)
debug Live introspection: sessions, health, metrics, memory
log Logging configuration and viewing
compliance Compliance management
memori Persistent checkpointing and agent-state survival

Backward compatibility: Old flat commands (cortex chat, cortex serve, cortex restart, cortex start, cortex stop) have been removed as of v0.51.0. Use cortex agent chat, cortex server start, cortex daemon start|stop|restart directly.


cortex agent

cortex agent chat                          # Start a new chat session (TUI)
cortex agent chat --model gpt-4o           # Override the active model
cortex agent chat --agent my-agent         # Use a specific agent
cortex agent chat --resume sess_abc123     # Resume an existing session
cortex agent chat --no-stream              # Disable streaming output

cortex agent tui                           # Full-featured terminal UI

cortex agent exec "fix the eslint config"  # One-shot non-interactive
cortex agent exec --json "summarize"       # JSON output for CI/scripting
cortex agent exec --max-turns 5 "..."      # Limit tool-call rounds
cortex agent exec -o result.md "..."       # Write response to file

cortex agent list                          # List all agents
cortex agent show my-agent                 # Show agent details
cortex agent create "Security Auditor"     # Create a new agent
cortex agent update my-agent               # Update an existing agent
cortex agent delete my-agent               # Delete an agent
cortex agent select my-agent               # Set as default agent
cortex agent inspect my-agent              # Inspect agent identity
cortex agent clone my-agent "Clone"        # Clone an existing agent
cortex agent import https://...           # Import from marketplace/URL

cortex agent sessions                      # List recent sessions
cortex agent eval                          # Run evaluation suites
cortex agent reflect                       # Inspect consolidation
cortex agent lint                          # Audit agent config
cortex agent voice                         # Manage voice settings

Slash Commands in Chat

Available during interactive chat sessions:

Command Description
/model <name> Switch model mid-session
/compact Trigger context compaction
/status Show session info
/clear Clear chat history
/save [file] Save transcript to file
/load <file> Load transcript from file
/export Export session as markdown
/theme <name> Switch theme (dark/light/contrast)
/diff Show last file change as diff
/review Review pending tool approvals
/plan Enter planning mode
/help List all commands and keybindings
/! <cmd> Execute bash command in sandbox
/exit, /quit Exit chat session

cortex server

cortex server start                         # http://127.0.0.1:3000 (foreground)
cortex server start --port 8080 --host 0.0.0.0
cortex server start -d                      # Run in background (daemon mode)
cortex server start -d -r                   # Restart background server
cortex server start -s                      # Stop background server
cortex server stop                          # Stop background server
cortex server restart                        # Restart background server

cortex daemon

cortex daemon start                  # Start supervisor in background
cortex daemon stop                   # Stop all daemon processes
cortex daemon restart                # Restart daemon processes
cortex daemon run                    # Run supervisor in foreground
cortex daemon status                 # Show daemon health

Three daemon processes: Validator (policy enforcement), Executor (tool execution), Scheduler (cron + memory consolidation). Auto-restart with exponential backoff (min(2^n × 1s, 30s)).


cortex sandbox

cortex sandbox run script.py                 # Execute with language inference
cortex sandbox run script.sh --lang bash      # Explicit language
cortex sandbox run broken.py --fix            # Auto-fix loop on failure
cortex sandbox run broken.py --fix --max-fix 10
cortex sandbox run script.py --no-sandbox     # Skip Docker, use subprocess

cortex config

cortex config get defaultAgent              # Read a config value
cortex config set defaultAgent "assistant"  # Set a config value
cortex config set agents.myAgent.model "gpt-4"  # Dot-notation nesting
cortex config set providers.openai.apiKey "sk-..."  # Auto-encrypted storage
cortex config unset agents.oldAgent         # Remove a key
cortex config list                          # Pretty-print (secrets redacted)
cortex config validate                      # Check schema compliance

cortex self

cortex self update --check                  # Check for available updates
cortex self update                          # Apply latest update
cortex self update --channel pre-release    # Use pre-release channel
cortex self update --status                 # Show current/latest version
cortex self update --rollback               # Rollback to previous version

cortex db

cortex db migrate                           # Initialize or migrate databases

cortex mcp

cortex mcp chrome start                     # Start Chrome Bridge (browser automation)
cortex mcp chrome stop                      # Stop Chrome Bridge
cortex mcp chrome status                    # Show Chrome Bridge status
cortex mcp chrome tools                     # List available browser tools

cortex mcp a2a card                         # Show A2A agent card
cortex mcp a2a skills                       # List A2A skills
cortex mcp a2a remote                       # List remote A2A agents

cortex mcp gateway status                   # MCP Gateway health
cortex mcp gateway health                   # MCP Gateway health check

cortex setup

cortex setup                                # Re-run the setup wizard

Configures provider credentials, default model, agent identity, and optional features (embedding, voice, channels).


cortex login

cortex login                              # Interactive username+password login
cortex login --token <token>              # Login with an API token
cortex login --host http://localhost:11434  # Specify server URL

Auth token stored in ~/.cortex/auth.json.

cortex logout

cortex logout                             # Clear stored authentication token

cortex whoami

cortex whoami                             # Show current user, teams, and role

cortex users

cortex users list                         # List all users (instance admin)
cortex users create <username> <password>  # Create a new user (instance admin)
cortex users disable <userId>             # Disable a user (instance admin)
cortex users enable <userId>              # Enable a disabled user (instance admin)

cortex teams

cortex teams list                         # List your teams
cortex teams create <name>                # Create a team (instance admin)

cortex debug

Live introspection tools for debugging active agent sessions and system health:

cortex debug sessions                    # List all active sessions
cortex debug memory                      # Show memory subsystem metrics
cortex debug health                      # Show system health overview
cortex debug metrics                     # Show performance metrics
cortex debug tools                       # List all tools an agent can access
cortex debug daemons                     # Show daemon process status

cortex memory

cortex memory search "pattern"              # Search memory
cortex memory add "fact" --type semantic    # Add memory entry
cortex memory health                        # Show memory system health
cortex memory heuristics                    # Show consolidation heuristics

cortex jobs

cortex jobs list                            # List all scheduled jobs
cortex jobs add --name "backup" --cron "0 0 * * *" --command "..."
cortex jobs cancel <job-id>                 # Cancel a scheduled job
cortex jobs run-due                         # Run all due jobs immediately

cortex vault

cortex vault list                           # List stored secrets
cortex vault set <key> <value>              # Store encrypted secret
cortex vault get <key>                      # Decrypt and retrieve
cortex vault delete <key>                   # Remove a stored secret

cortex policy

cortex policy list                          # List security policy rules
cortex policy add --rule "..."              # Add a policy rule
cortex policy delete <rule-id>              # Remove a policy rule
cortex policy enable <rule-id>              # Enable a disabled rule
cortex policy disable <rule-id>             # Disable (without deleting)

cortex plugins

cortex plugins list                         # List installed plugins
cortex plugins install <name>               # Install from marketplace
cortex plugins uninstall <name>             # Uninstall a plugin
cortex plugins enable <name>                # Enable a disabled plugin
cortex plugins disable <name>               # Disable (without uninstalling)
cortex plugins info <name>                  # Show plugin details

cortex marketplace

cortex marketplace list                     # List available plugins/agents
cortex marketplace search <query>           # Search marketplace
cortex marketplace info <name>              # Show item details
cortex marketplace install <name>           # Install from marketplace

cortex models

cortex models list                          # List configured LLM models
cortex models set <provider> <model>        # Set active model for provider
cortex models test <provider>               # Test provider connectivity

cortex git

cortex git status                           # Show workspace status
cortex git diff                             # Show workspace diff
cortex git commit -m "message"              # Commit changes
cortex git log                              # Show commit history

cortex github

cortex github pr list                       # List open pull requests
cortex github pr create                     # Create a new PR
cortex github issue list                    # List open issues
cortex github issue create                  # Create a new issue
cortex github repo list                     # List repos

cortex node

cortex node connect <url>                   # Connect to a hub node
cortex node disconnect                      # Disconnect from hub
cortex node status                          # Show node connection status

cortex channels

cortex channels list                        # List configured channels
cortex channels enable <name>               # Enable a channel
cortex channels disable <name>              # Disable a channel
cortex channels config <name>               # Configure channel settings

cortex triggers

cortex triggers list                        # List event triggers
cortex triggers add --event "..."" --action "..."
cortex triggers delete <trigger-id>
cortex triggers enable <trigger-id>
cortex triggers disable <trigger-id>

cortex workflow

cortex workflow list                        # List workflows
cortex workflow run <name>                  # Execute a workflow
cortex workflow status <run-id>             # Check run status

cortex import

Import data from other agent platforms and formats:

cortex import openclaw                       # Import from OpenClaw (config, sessions, memory)
cortex import openclaw --config-only         # Import only config (providers, agents, model pool)
cortex import openclaw --sessions-only       # Import only session transcripts
cortex import openclaw --memory-only         # Import only memory files (MEMORY.md, SOUL.md, USER.md)
cortex import openclaw --dry-run              # Preview what would be imported

cortex import hermes                         # Import from Hermes (config, state.db, memory)
cortex import hermes --config-only            # Import only config.yaml
cortex import hermes --sessions-only          # Import from state.db or JSONL exports
cortex import hermes --memory-only            # Import SOUL.md, MEMORY.md, USER.md, skills/

cortex import zeroclaw                        # Import from ZeroClaw

cortex import transcripts <dir>              # Import from JSONL transcript directory

cortex import config openclaw <path>         # Convert OpenClaw config to Cortex format
cortex import config openclaw --dry-run       # Preview config conversion

Supports --dry-run for all sources. Auto-discovers config files, state databases, and memory files from detected directories.


cortex qm

Quartermaster tool orchestration learning — analyze and manage tool selection patterns:

cortex qm patterns                           # Show learned tool selection patterns
cortex qm weights                            # Show current tool weights
cortex qm stats                              # Show orchestration statistics
cortex qm decisions                          # Show recent tool decisions
cortex qm accuracy                           # Show prediction accuracy metrics
cortex qm reset                              # Reset all learned patterns and weights

cortex mqm

Model Quartermaster (MQM) — analyze and manage model selection intelligence:

cortex mqm stats                             # Show MQM statistics
cortex mqm decisions                         # Show recent model selection decisions
cortex mqm weights                           # Show signal weights
cortex mqm accuracy                          # Show model selection accuracy

cortex eval

Run agent evaluation suites and manage baselines:

cortex eval list                             # List available evaluation suites
cortex eval run <name>                       # Run a specific evaluation suite
cortex eval baselines                        # Show evaluation baselines and scores

cortex projects

cortex projects list                        # List projects
cortex projects create <name>               # Create a new project
cortex projects use <name>                  # Set active project
cortex projects delete <name>               # Delete a project

cortex log

cortex log show                             # Show recent log entries
cortex log tail                             # Follow log output
cortex log clear                            # Clear log file
cortex log set-level <level>                # Set log level (debug/info/warn/error)
cortex log path                             # Show log file path
cortex log status                           # Show logging configuration

cortex memori

cortex memori list <session-id>             # List checkpoints for session
cortex memori create <session-id>           # Create a manual checkpoint
cortex memori restore <checkpoint-id>       # Restore session to checkpoint
cortex memori delete <checkpoint-id>        # Delete a checkpoint

cortex install / cortex uninstall

cortex install                          # Install daemon + server as system services
cortex install --port 8080 --host 0.0.0.0
cortex install --daemon-only            # Install only the daemon service
cortex install --server-only            # Install only the server service
cortex install --no-start               # Create service files without starting
cortex uninstall                        # Remove all system services
cortex uninstall --daemon-only          # Remove only the daemon service
cortex uninstall --server-only          # Remove only the server service

Manages Cortex as system services via systemd (Linux), launchd (macOS), or NSSM (Windows).


cortex agent lint

cortex agent lint check <agent-id>          # Audit agent config, tools, plugins
cortex agent lint config                    # Show lint configuration

cortex compliance

cortex compliance check                     # Run compliance checks
cortex compliance report                    # Generate compliance report

cortex desktop

cortex desktop install                      # Install desktop app dependencies
cortex desktop build                        # Build desktop app
cortex desktop run                          # Run desktop app in dev mode

cortex service

cortex service list                         # List micro-services
cortex service show <name>                  # Show service details
cortex service create <name>                # Create a new service
cortex service update <name>                # Update service configuration
cortex service delete <name>                # Delete a service
cortex service start <name>                 # Start a service
cortex service stop <name>                  # Stop a service
cortex service status <name>                # Show service status
cortex service install                      # Install as system service
cortex service uninstall                    # Remove system service

Global Flags

All commands support these global flags:

Flag Description
--json Machine-readable JSON output
-v, --verbose Enable verbose debug logging
--no-color Disable ANSI color output
--config <path> Override config file path
-m, --model <model> Override default model
--profile <name> Config profile to use

See Also

Clone this wiki locally