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 Overview

The ZERG CLI is a standalone LuaJIT binary (~2.9 MB) with cli_commands=92 command-table entries (64 user-facing top-level verbs plus 2 internal) and cli_subcommands=37 subcommands across its command families for managing the ZERG platform.

Installation

From the repository root:

(cd zerg-cli && bash build/build.sh)
# Binary at: zerg-cli/zerg
sudo cp zerg-cli/zerg /usr/local/bin/

Configuration

The built-in default API URL is http://127.0.0.1:21434 (the local loopback API) — set a profile or --api-url for a remote server. There is no zerg config subcommand; the CLI reads ~/.zerg/config.json, environment variables, and global flags:

# Environment variables
export ZERG_API_URL=https://your-server.example
export ZERG_TOKEN=<your-token>

# Or global flags — these must appear BEFORE the command
zerg --api-url https://your-server.example status

# Or log in: mints a token against Mango auth and stores it in ~/.zerg/config.json
zerg --api-url https://your-server.example login --email user@example.com

Named profiles live in ~/.zerg/config.json (edit the file directly) and are selected with the global --profile <name> flag. See CLI Configuration for the file layout and resolution order.

Shell Completion

# Bash
zerg completion bash > /etc/bash_completion.d/zerg

# Zsh
zerg completion zsh > "${fpath[1]}/_zerg"

# Fish
zerg completion fish > ~/.config/fish/completions/zerg.fish

Command Groups

GroupCommandsDescription
Healthstatus, metricsServer health and metrics
Modelsdiscover, list, ps, show, start, stop, stop-all, prepareModel management
Inferencerun, chatOpenAI and Anthropic API completions
Workersagents, spawn, kill, task, task-cancel, task-statusAgent worker management
Workflowlist, start, show, cancel, branch, tree, lineageMulti-step workflows
Bg Workersstart, list, status, logs, killBackground workers
Schedulelist, add, show, pause, unpause, run, deleteJob scheduling
Channelschannels, channel-add, channel-remove, channel-test, channel-sendDelivery channels
Recipesrecipe-list, recipe-show, recipe-run, recipe-reloadWorkflow recipe templates
Skillsskills, skill-search, skill-register, skill-removeAgent skill management
Keyringkeyring-test, keyring-set, keyring-get, keyring-deleteOS keyring integration
Pluginplugin-eval, plugin-workers, plugin-spawnLua sandbox workers
ZMQzmq-workers, zmq-dispatch, zmq-statusZMQ worker management
Clustercluster, catalog, join, leaveCluster management
Circuitscircuits, circuits-resetCircuit breaker management
Authlogin, logoutAuthentication
Updatecheck, download, apply, rollbackSelf-update management
CompletioncompletionShell completion scripts
Diagnosticsdoctor, support-bundleHealth verdict + redacted incident bundle

Diagnostics

# One health/readiness verdict (exit 0 only when both probes are healthy)
zerg doctor

# Redacted incident bundle: version, config posture, health, log tails
zerg support-bundle /tmp/zerg-support --log-dir /var/log/runit/zerg-sol

support-bundle never writes token/secret-keyed values: secret-keyed environment/config values and log secrets are replaced with <redacted>, and a final scan removes the artifacts created by that run and refuses if any known secret is found. The output directory must be a new path — an existing directory is refused and is never written into or deleted. See the main CLI reference for the file list and behavior.

Examples

# Check server status
zerg status

# List available models
zerg list

# Start inference (model name is a catalog/lane id, positional)
zerg start glm-4.7-flash

# Start a workflow
zerg workflow start code-review

# Check background workers
zerg bg-workers list

# Login (prompts for password)
zerg login --email user@example.com

# Get JSON output
zerg status --format json