Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Commands

Complete reference for all ZERG CLI commands. The CLI is a standalone LuaJIT binary (~2.9 MB) with zero Python dependency.

Canonical: docs/cli-reference.md — this page is the portal split; where wording differs, cli-reference.md wins.

Global Flags

Global flags are only parsed before the command name (the first positional argument); everything after the command is the command’s own argv (--token after the boundary belongs to the command, e.g. channel-add, and is never a global credential). --json, --format and --quiet are additionally honored after the command name.

FlagDescription
--jsonOutput raw JSON
--token <token>Deprecated global auth form (use --bearer or ZERG_TOKEN); argv-visible, prints a loud warning
--bearer <token>Explicit global auth token (must appear before the command)
--profile <name>Use named profile (global — must appear before the command)
--api-url <url>Override server URL (global — must appear before the command)
--format <fmt>Output format (text or json)
--quietSuppress ANSI styling/status decorations (enforced at the output boundary)
--versionPrint version
--helpShow help

Infrastructure

status

Show server health and status.

zerg status
zerg status --format json

discover

Scan for available models and register them.

zerg discover

show

Display details for a specific model.

zerg show <model-name>

metrics

Show server inference metrics (model lifecycle counters, requests, tokens, errors, durations) as a formatted table.

zerg metrics

Models & Inference

list

List all discovered models and their status.

zerg list
zerg list --json

start

Start a model. <model> is positional.

zerg start glm-4.7-flash
zerg start glm-4.7-flash --temp 0.7 --top-p 0.9 --batch-size 512 --template default
FlagDescription
<model> (positional)Model to start (required)
--temp <f>Sampling temperature
--top-p <f>Top-p sampling
--batch-size <n>Batch size
--template <name>Start template

stop

Stop a running inference instance. <model> is positional.

zerg stop glm-4.7-flash

stop-all

Stop all running inference instances.

zerg stop-all

prepare

Sync a model from NFS to local disk. <model> is positional.

zerg prepare glm-4.7-flash

Workers

ps

List running worker processes.

zerg ps

spawn

Spawn a new worker process.

zerg spawn
zerg spawn --count 3 --worker-path /path/to/worker
FlagDescription
--count <n>, -n <n>Number of workers to spawn
--worker-path <path>Path to the worker binary

kill

Kill a running agent worker. <agent_id> is positional.

zerg kill <agent-id>

agents

List running agents.

zerg agents

Chat & Inference

chat

Send a single prompt via the Anthropic Messages API (/v1/messages) and print the response. <prompt> is positional and required; streaming is the default.

zerg chat "Explain quicksort" --model glm-4.7-flash
zerg chat "What is 2+2?" --no-stream
zerg chat "Explain monads" --system "Be concise"
FlagDescription
--model <name>, -m <name>Model slug (defaults to default)
--system <text>, -s <text>System prompt
--no-streamReturn complete response
--temp <f>Temperature
--top-p <f>Top-p sampling
--max-tokens <n>Maximum output tokens (default 4096)
--low-speed-time <s>Seconds of stream inactivity before abort (default 60)
--low-speed-limit <b/s>Bytes/s below which a stream counts as stalled (default 1)
--verbose, -vShow token count/usage

run

Send a single prompt via the OpenAI-compatible completions endpoint and print the response. <prompt> is positional and required; streaming is the default.

zerg run "Explain this function"
zerg run --model glm-4.7-flash "What is OTP?"
zerg run --no-stream --temp 0.3 --max-tokens 4096 "Write a fib function"
FlagDescription
--model <name>, -m <name>Model slug (defaults to default)
--no-streamReturn complete response
--temp <f>Temperature
--top-p <f>Top-p sampling
--max-tokens <n>Maximum output tokens
--timeout <ms>Request timeout in milliseconds (non-streaming only)
--low-speed-time <s>Seconds of stream inactivity before abort (default 60)
--low-speed-limit <b/s>Bytes/s below which a stream counts as stalled (default 1)
--verbose, -vShow token count after response

Tasks

task

Dispatch a task to an agent worker. <agent_id> and <prompt> are positional; streaming is the default.

zerg task <agent-id> "Fix the bug in main.rs"
zerg task <agent-id> --no-stream --wait "Fix the bug in main.rs"
FlagDescription
--no-streamQueue task without streaming
--streamForce SSE streaming
--waitPoll for the result (with --no-stream); Ctrl-C exits 130
--verbose, -vShow token count

task-cancel

Cancel a running task.

zerg task-cancel <task-id>

task-status

Get detailed task status.

zerg task-status <task-id>

Workflows

workflow list

List all workflows.

zerg workflow list

workflow start

Start a new workflow. <name> is positional.

zerg workflow start code-review
zerg workflow start deploy

workflow show

Show workflow details and current state.

zerg workflow show <workflow-id>

workflow cancel

Cancel a running workflow.

zerg workflow cancel <workflow-id>

workflow branch

Create a branch in a workflow. Takes no flags — the server derives the branch.

zerg workflow branch <workflow-id>

workflow tree

Display the workflow step tree.

zerg workflow tree <workflow-id>

workflow lineage

Show workflow execution lineage.

zerg workflow lineage <workflow-id>

Background Workers

bg-workers start

Start a background worker. <task> is positional.

zerg bg-workers start "Refactor the auth module"

bg-workers list

List all background workers.

zerg bg-workers list

bg-workers status

Show background worker status.

zerg bg-workers status <worker-id>

bg-workers logs

Show background worker logs (single fetch, no streaming; no flags).

zerg bg-workers logs <worker-id>

bg-workers kill

Kill a background worker.

zerg bg-workers kill <worker-id>

Scheduler

schedule list

List all scheduled jobs.

zerg schedule list

schedule add

Create a new scheduled job. <prompt> is positional.

zerg schedule add "Run health check" --cron "0 */6 * * *"
zerg schedule add "Sync models" --every 3600
FlagDescription
--cron <expr>Cron expression
--every <seconds>Interval in seconds
--at <epoch-seconds>One-time execution (Unix epoch seconds — an ISO 8601 string is silently dropped)
--name <name>Job name
--model <name>, -m <name>Model to use
--deleteDelete the job after one run

Exactly one schedule source is sent: --every wins over --cron, which wins over --at.

schedule show

Show job details.

zerg schedule show <job-id>

schedule pause

Pause a scheduled job.

zerg schedule pause <job-id>

schedule unpause

Resume a paused job.

zerg schedule unpause <job-id>

schedule run

Trigger a scheduled job immediately.

zerg schedule run <job-id>

schedule delete

Delete a scheduled job.

zerg schedule delete <job-id>

Cluster

cluster

List cluster nodes.

zerg cluster

catalog

Show the global model catalog across all cluster nodes.

zerg catalog

join

Join a cluster node.

zerg join <node@host>

leave

Leave the cluster.

zerg leave

Channels & Skills

channels

List communication channels.

zerg channels

channel-add

Register a delivery channel. Type defaults to telegram, which requires --token and --chat-id (or a --config JSON object).

zerg channel-add --type telegram --token "BOT_TOKEN" --chat-id "CHAT_ID" --name "alerts"
zerg channel-add --type discord --webhook-url "https://discord.com/api/webhooks/..." --name "ops"
zerg channel-add --type telegram --config '{"bot_token":"...","chat_id":"..."}'
FlagDescription
--type <t>, -t <t>Channel type: telegram (default), discord, webhook
--token <tok>Telegram bot token
--chat-id <id>Telegram chat ID
--webhook-url <url>Discord webhook URL (--url also accepted for discord)
--url <url>Webhook URL (required for --type webhook)
--name <name>Channel display name
--config <json>JSON config object (overrides the per-type flags)

channel-remove

Remove a channel.

zerg channel-remove <channel-id>

channel-test

Test channel connectivity.

zerg channel-test <channel-id>

channel-send

Send a message to a channel. <channel_id> and <message> are positional.

zerg channel-send <channel-id> "Deploy complete"

skills

List registered skills.

zerg skills

Search for skills.

zerg skill-search "code review"

skill-register

Register a new skill from a JSON skill-definition file. <file> is positional.

zerg skill-register ./my-skill.json

skill-remove

Remove a registered skill. <name> is positional.

zerg skill-remove <name>

Recipes

recipe-list

List available recipes.

zerg recipe-list

recipe-show

Show recipe details.

zerg recipe-show <recipe-name>

recipe-run

Execute a recipe.

zerg recipe-run <recipe-name>

recipe-reload

Reload recipe definitions.

zerg recipe-reload

Circuits & Plugins

circuits

List circuit breaker states.

zerg circuits

circuits-reset

Force reset a circuit breaker to closed state. <key> is positional (one breaker per call — there is no reset-all).

zerg circuits-reset <key>

plugin-eval

Evaluate a Lua expression in the plugin sandbox.

zerg plugin-eval "return 1 + 1"

plugin-workers

List plugin-managed workers.

zerg plugin-workers

plugin-spawn

Spawn a Lua sandbox worker.

zerg plugin-spawn --script <path>

ZMQ

zmq-workers

List ZMQ-connected workers.

zerg zmq-workers

zmq-dispatch

Dispatch a task to a ZMQ worker. <prompt> is positional.

zerg zmq-dispatch "Analyze this log" --model glm-4.7-flash
FlagDescription
--model <name>, -m <name>Model to use
--context <text>Additional context

zmq-status

Show ZMQ gateway status.

zerg zmq-status

Authentication

login

Authenticate with a ZERG server (Mango auth). <account>/--email/-e is the username; the password is prompted with echo hidden when --password is omitted. --password is deprecated (argv-visible via ps, loud warning). Pass --keyring to store the bearer in the OS keyring instead of ~/.zerg/config.json.

zerg login --email user@example.com
zerg login --keyring user@example.com

logout

Clear authentication credentials.

zerg logout

keyring-test

Test keyring access.

zerg keyring-test

keyring-set

Store an API key in the OS keyring. <provider> is positional (e.g. openai); it prompts for the key with echo hidden, or accepts the deprecated --key form (argv-visible, loud warning).

zerg keyring-set openai

keyring-get

Retrieve an API key (masked) from the OS keyring. <provider> is positional.

zerg keyring-get openai

keyring-delete

Remove a stored API key from the OS keyring. <provider> is positional.

zerg keyring-delete openai

Update

update check

Check for CLI updates.

zerg update check

update download

Download a new version.

zerg update download

update apply

Apply a downloaded update.

zerg update apply [--install-dir DIR]

The install root is never defaulted to /opt/zerg (the LEGACY Sol root): it is derived from the running zerg executable when that is a real installed layout (zerg + VERSION), and refused for /opt/zerg or any tree carrying bin/sol (a Sol install). Pass --install-dir for other layouts. The post-install probe execs the installed binary; a failure rolls back automatically.

update rollback

Rollback to the previous version.

zerg update rollback [--install-dir DIR]

Restores the newest <root>.*.bak tree (same root resolution/refusals as apply) — normally only after an interrupted apply (a successful apply removes its backup; a failed health check auto-rolls-back with it).

update trust-key

Deliberately re-pin the release signing key (TOFU override). Key changes detected against the pin are refused by the updater; this command is the explicit operator acknowledgement that the key rotated. <keyfile> is positional.

zerg update trust-key /path/to/new/minisign.pub

Shell Completion

completion

Generate shell completion scripts.

zerg completion bash >> ~/.bashrc
zerg completion zsh > ~/.zfunc/_zerg
zerg completion fish > ~/.config/fish/completions/zerg.fish

See Shell Completion for detailed setup instructions.

Additional Command Families

These families are documented in full in the repository’s canonical CLI reference (docs/cli-reference.md); the portal split keeps a one-line entry here so no registered command disappears from the portal:

# Channel pause/resume (POST-only server routes)
zerg channel-pause <channel_id>
zerg channel-resume <channel_id>

# Skills marketplace install (registry-backed)
zerg skill install <name> <author>

# Team mailbox verbs
zerg team mail list --team <id>
zerg team mail send --team <id> --to <member> --body <text>

# Analytics summaries
zerg analytics summary --days 30
zerg analytics top-tools --limit 5
zerg analytics cost --days 14

# Admin identity operations
zerg admin unlock <user_uuid>
zerg admin revoke-token <token_id>

# OAuth device/PKCE login
zerg oauth login <provider>
zerg oauth status
zerg oauth logout <provider>

# Session shares
zerg session share --file session-export.json --ttl-days 7