Skip to main content

CLI

The ZeroWidth CLI puts your workspace in the terminal: list and run flows, chat with one, search the docs, and call any tool your token can reach — from a shell, a script, or a CI job.

npm install -g @zerowidth/cli

That installs two commands, zerowidth and the short alias 0w, which are interchangeable. It needs Node.js 22 or later. To try it without installing, npx @zerowidth/cli flow ls.

Getting signed in

zerowidth login     # opens a browser to authorize
zerowidth doctor    # checks node, the API, and your token
zerowidth whoami    # who you are, and what your token can see

login opens a browser. On a machine without one — a server, a container — zerowidth login --paste takes a personal access token you paste in instead.

Running a flow

zerowidth flow ls
zerowidth flow run flw_2nQs

In a terminal, flow run is interactive: it asks for the inputs the flow declares, and if the flow takes chat, it drops you into a conversation with it. Outside a terminal — piped, or in CI — the same command runs once and prints the result, so the two uses don't need different scripts. Force the one-shot behavior anywhere with --non-interactive.

Pass inputs directly when you don't want the prompts:

zerowidth flow run flw_2nQs --input ticket="card declined twice"
zerowidth flow run flw_2nQs --input-json '{"ticket": "…"}'

A flow you've exported runs without touching the API at all:

zerowidth flow run --local ./my-flow.zwf

Inside the chat, /help lists what's available — /retry, /edit to open your editor, /save and /export, /branch to fork the conversation, /trace to see what the flow did.

Answering in a room from your own machine

Bring an agent into a room from its People menu, save the token it shows you once, and run it in the folder you want it to read:

zerowidth room-agent connect zwa_…
zerowidth room-agent --cwd ~/code/my-repo

It answers whenever someone in that room @mentions it. Nothing connects in: the command asks ZeroWidth for work, runs Claude Code with that room's context, and posts the answer back.

Claude Code is read-only here — it reads and searches the files in that folder, never edits them or runs commands, and .env, .pem and .key files are off limits. Each room keeps its own session, so follow-up questions carry on from earlier ones.

The token is saved per profile, so a client's workspace and your own can each keep their own agent. zerowidth room-agent disconnect forgets it.

Reading the docs from the terminal

zerowidth docs search "idempotency"
zerowidth docs get overview/api/idempotency

Profiles and sessions

zerowidth profile keeps separate credentials side by side — your own workspace, a client's, a staging environment — and zerowidth profile use <name> switches between them. zerowidth session lists and reopens saved chats. zerowidth config holds settings that persist between runs.

Anything else

Every tool your token can reach is callable, whether or not the CLI wraps it in a command of its own:

zerowidth mcp inspect            # everything this token can see
zerowidth mcp call <tool> --arg k=v

Open source

The CLI is public and Apache-2.0, at @zerowidth/cli. Read it, fork it, or file an issue.

3 min read