Command line reference
ZoiGent CLI
Autonomous agent missions from your terminal. Start work, follow it, and wire ZoiGent into scripts and CI with the same account and the same Agent API that powers the app.
Reference for version 1.0.0, the current release. Requires Node.js 18 or later.
01 · Install
Install the CLI
The CLI is published as an npm package and installs one command, zoigent, on your path.
npm i -g zoigent # Check the install zoigent --version # 1.0.0 zoigent --help
02 · API key & login
Get a key and log in
Create an API key in the web app under Settings → Developer API. Keys start with zg_. Then save it with the CLI: with no argument it asks you to paste the key, and it stores the key in a config file readable only by your user account.
zoigent login # paste your zg_ key when asked zoigent login <key> # or pass it directly zoigent whoami # confirm which key and account are active zoigent doctor # confirm the Agent API is reachable
03 · Commands
Every command
Mission and automation ids can be shortened: pass a unique prefix of the id instead of the whole thing, and the CLI resolves it. If a prefix matches more than one mission, it asks for more characters.
| Command | What it does |
|---|---|
zoigent login [key] | Save a zg_ API key locally. With no key argument it asks you to paste one. The saved file is written with owner-only permissions. |
zoigent whoami | Show the current API key identity, its key name and scopes, and the API URL in use. |
zoigent doctor | Check connectivity to the Agent API and confirm the saved key authenticates. |
zoigent run "<task>" | Start a mission from a task description. Prints the mission id, the estimated credits, and a link to watch it in the app. |
zoigent ls [--limit N] | List recent missions with id, status, credits, and title. Defaults to 20, up to 100. `zoigent list` works too. |
zoigent status <id> | Show one mission in detail: status, steps, and progress. |
zoigent logs <id> | Show the message log for one mission. |
zoigent cancel <id> | Cancel a running mission. |
zoigent automations ls | List your automations, whether each is on or off, and how it triggers. |
zoigent automations run <id> | Trigger an automation now. Prints the mission it started. |
zoigent run "Research the latest guidance and write a one-page brief" zoigent ls zoigent status <mission-id> zoigent logs <mission-id>
04 · Flags
Flags
| Flag | What it does |
|---|---|
--follow, -f | With `run`: stream step updates while the mission runs, until it finishes. |
--wait, -w | With `run`: block until the mission finishes, and exit with code 1 if it fails. Made for CI and cron. |
--json | Machine-readable JSON output. Available on every command. |
--limit N, -n N | With `ls`: how many recent missions to list (default 20, maximum 100). |
--help, -h | Print the usage summary. |
--version, -v | Print the CLI version and exit. |
05 · Environment
Environment and config
| Variable | What it does |
|---|---|
ZOIGENT_API_KEY | API key to use instead of the saved login. Best for CI and other automated environments. |
ZOIGENT_API_URL | Agent API base URL. Defaults to the production API; set it only to point the CLI at another deployment. |
The saved login lives in ~/.config/zoigent/config.json (or $XDG_CONFIG_HOME/zoigent/config.json), written with owner-only permissions. Treat it like a password: anyone with the key can start missions as you.
06 · Scripts & CI
Use it from scripts and CI
Skip the saved login in automation: set the key in the environment, then pair --wait with --json. The command exits 1 when the mission fails, so a pipeline step fails with it.
export ZOIGENT_API_KEY=zg_... zoigent run "Nightly summary of open missions" --wait --json
Looking for the other ways in? The download page covers the web app, desktop app, and browser extension, and the docs cover the Developer API the CLI is built on.