Skip to content

CLI Reference

bash
protege <command> [options]

Most commands render formatted output by default and switch to raw JSON with --json.

Global Flags

FlagDescription
-h, --help, helpShow help for any command
-v, --version, versionShow installed version

protege setup

Interactive guided setup for new projects. Creates config files, prompts for provider and keys, optionally bootstraps relay mode.

bash
protege setup [options]
OptionDescription
--path <dir>Project directory (default: current)
--reset, --forceOverwrite existing config files
--provider <name>LLM provider: openai, anthropic, gemini, grok
--inference-api-key <key>Provider API key
--outbound <mode>relay or local
--relay-ws-url <url>Relay WebSocket URL
--web-search-provider <name>none, perplexity, or tavily
--web-search-api-key <key>Web search API key
--admin-contact-email <email>Failure alert recipient
--doctorRun health check after setup
--non-interactiveSkip all prompts, use flags only
--jsonJSON output

Example: fully non-interactive setup

bash
protege setup \
  --non-interactive \
  --provider anthropic \
  --inference-api-key sk-ant-... \
  --outbound relay \
  --relay-ws-url wss://relay.protege.bot/ws \
  --web-search-provider tavily \
  --web-search-api-key tvly-... \
  --admin-contact-email admin@example.com \
  --doctor

protege init

Scaffolds project files without the interactive wizard. Use this for advanced manual setup.

bash
protege init [--path <dir>] [--reset|--force] [--json]

protege gateway

Manage the gateway process (SMTP server + inference runtime).

bash
protege gateway <start|stop|restart> [--dev]
SubcommandDescription
startStart the gateway
stopStop the running gateway
restartStop and restart
OptionDescription
--devRun in dev mode (no real email delivery)

Example:

bash
protege gateway start
protege gateway start --dev    # Local development mode
protege gateway restart

protege persona

Manage agent personas (identities).

bash
protege persona <create|list|info|delete> [options]
SubcommandDescription
create [name]Create a new persona
listList all personas
info <id>Show persona details
delete <id>Delete a persona
OptionDescription
--name <display_name>Display name (alternative to positional arg)
--jsonJSON output

Examples:

bash
protege persona create "Research Assistant"
protege persona create --name "DevOps Bot"
protege persona list
protege persona list --json
protege persona info 5d52
protege persona delete 5d52

The <id> can be a full persona ID, a unique prefix, or an email local part.


protege relay bootstrap

Configure relay mode for an existing project.

bash
protege relay bootstrap [options]
OptionDescription
--relay-ws-url <url>WebSocket URL (e.g., wss://relay.protege.bot/ws)
--reconnect-base-delay-ms <n>Initial reconnect delay
--reconnect-max-delay-ms <n>Max reconnect delay
--heartbeat-timeout-ms <n>Heartbeat timeout
--jsonJSON output

Example:

bash
protege relay bootstrap --relay-ws-url wss://relay.protege.bot/ws

protege scheduler sync

Sync responsibility markdown files to the database.

bash
protege scheduler sync [--persona <id>] [--json]

Example:

bash
protege scheduler sync                    # Sync all personas
protege scheduler sync --persona 5d52     # Sync one persona

protege chat

Open the terminal inbox/thread client.

bash
protege chat [--persona <id>] [--thread <thread_id>]
OptionDescription
--persona <id>Filter to one persona
--thread <thread_id>Jump directly to a thread

See the Chat Guide for keybindings and usage.


protege status

Show runtime status (gateway running, persona count, config validity).

bash
protege status [--json]

protege doctor

Run a comprehensive health check — validates config files, personas, provider keys, and extensions.

bash
protege doctor [--json]

protege logs

View runtime logs.

bash
protege logs [options]
OptionDescription
--followStream new log entries
--tail <n>Show last N lines
--scope <name>Filter by scope: gateway, harness, relay, scheduler, chat, all
--jsonRaw JSON log output

Examples:

bash
protege logs --scope gateway --follow     # Watch gateway events
protege logs --scope scheduler --tail 50  # Last 50 scheduler entries
protege logs --json                       # Machine-readable output

protege daemon

Manage the gateway as a systemd service (Linux only).

bash
protege daemon <subcommand> [options]
SubcommandDescription
installCreate and register a systemd unit
reinstallUninstall + fresh install
uninstallRemove the systemd unit
startStart the daemon
stopStop the daemon
restartRestart the daemon
statusShow daemon status
infoShow unit details (path, PID, etc.)
logsView daemon logs
enableEnable auto-start on boot
disableDisable auto-start
OptionDescription
--userUser-scope systemd (default)
--systemSystem-scope systemd
--cwd <path>Workspace directory
--unit <name>Explicit unit name
--env-file <path>Environment file for the unit
--forceForce install over existing
--followFollow logs
--lines <n>Number of log lines
--jsonJSON output

See Daemon Operations for full lifecycle docs.