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
| Group | Commands | Description |
|---|---|---|
| Health | status, metrics | Server health and metrics |
| Models | discover, list, ps, show, start, stop, stop-all, prepare | Model management |
| Inference | run, chat | OpenAI and Anthropic API completions |
| Workers | agents, spawn, kill, task, task-cancel, task-status | Agent worker management |
| Workflow | list, start, show, cancel, branch, tree, lineage | Multi-step workflows |
| Bg Workers | start, list, status, logs, kill | Background workers |
| Schedule | list, add, show, pause, unpause, run, delete | Job scheduling |
| Channels | channels, channel-add, channel-remove, channel-test, channel-send | Delivery channels |
| Recipes | recipe-list, recipe-show, recipe-run, recipe-reload | Workflow recipe templates |
| Skills | skills, skill-search, skill-register, skill-remove | Agent skill management |
| Keyring | keyring-test, keyring-set, keyring-get, keyring-delete | OS keyring integration |
| Plugin | plugin-eval, plugin-workers, plugin-spawn | Lua sandbox workers |
| ZMQ | zmq-workers, zmq-dispatch, zmq-status | ZMQ worker management |
| Cluster | cluster, catalog, join, leave | Cluster management |
| Circuits | circuits, circuits-reset | Circuit breaker management |
| Auth | login, logout | Authentication |
| Update | check, download, apply, rollback | Self-update management |
| Completion | completion | Shell completion scripts |
| Diagnostics | doctor, support-bundle | Health 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