CLI
viewport-console commands, flags and exit codes.
viewport-console [command] [options]Console needs Node 22.13 or later (node:sqlite); on an older Node the CLI exits with Console needs Node 22.13 or later for node:sqlite; you have <version>. Run it from a source build:
alias viewport-console="node $PWD/packages/console/dist/cli/bin.js" from the console/ checkout.
With no command, viewport-console runs serve. Every other command talks to the running Console when one is
running (it finds it through <home>/server.json). Otherwise it opens the home directly. The CLI authenticates with
its own token in <home>/cli-token (0600), whose scopes are read, control and admin, never approve. It can
still mint a sign-in link (open), which signs in as the local admin, so treat the file as approve-equivalent.
That holds only in the default home (~/.viewport/console), the one home every daemon on the machine hides from its
agents. In any other home, including one named by $VIEWPORT_CONSOLE_HOME or one this machine's daemon verified,
an agent of a daemon started elsewhere could read the file, so while Console runs the token can only read, and so
can the links open mints. Commands that change something (pair, tokens, users, sources add, session
control) are refused with console.forbidden (details.reason: "cli_token_capped") and a message that says what
to do: act in the browser session serve opened (its link is never on disk and keeps every permission), stop
Console and run the command again (the CLI then opens the home itself, with full scopes), or use the default
home. doctor still answers; it prints home coverage (default, unverified, verified by this machine's daemon
only, or unprotected) and whether the CLI token is full or read only.
| Command | Does |
|---|---|
serve | Run in the foreground: bind, pair the local daemon, and sign you in (opens the browser in a terminal; --no-open prints the link). It adds no sources; use sources add |
up, down, logs | Run as a background process; stop it; print <home>/console.log. down signals only a Console it can prove is the one <home>/server.json names (the home's lock is held and /health at the recorded URL answers with the recorded run id); a stale server.json (after a crash or reboot) is removed and nothing is signalled |
open | Print a new single-use sign-in link (local mode); in a terminal it also opens it, --no-open only prints |
pair [<link>] [--replace] | Pair a daemon from a link (--replace re-pairs one already paired); with no link, the daemon running as this user |
daemons | List paired daemons with connection state and fingerprint |
daemons rm <daemon_id> | Unpair: peer.leave when online, else print the revoke command for the daemon |
sources | List sources |
sources add evals <dir> | Register an Evals results directory. Every source root is checked when added and on every read: never a symbolic link itself, never inside or a parent of a directory that holds keys (Console's home, the daemon's, the viewer's) |
sources add receipts <path> | Register a HITL receipts JSONL file |
sources add trajectories <dir> [--name <n>] | Register a directory of agent runs (core's JSONL store) |
sources add hitl --name <n> [--reply-url <u>] [--webhook] [--allow-private] | Register a HITL gate; prints VIEWPORT_HITL_CONSOLE_URL once (or a webhook URL and secret with --webhook). --allow-private lets the reply URL point at a private or shared range |
sources rm <source_id> | Remove a source |
tokens | List named tokens |
tokens add <name> --scopes read,control [--tenants a,b] | Create a token; prints it once |
tokens rm <name> | Revoke a token |
receipts | Verify Console's own receipt chain |
receipts anchor | Print the chain head to keep outside Console |
identity | Print Console's peer id and where its key is stored |
forget --home <dir> | Remove keychain entries an older version left for that home (a non-default home now keeps its keys in files). Never deletes files; refuses while that Console runs |
doctor | Report the home, auth mode, key storage, sealed secrets and isolation warnings |
identity rotate is manual in v1. Rotating means pairing every daemon again, so the CLI explains this instead of
rotating.
Options
| Option | Meaning |
|---|---|
--home <dir> | Console's home. Default VIEWPORT_CONSOLE_HOME, else ~/.viewport/console. Never inside the current folder or the temp directory (console.home_invalid). Prefer export VIEWPORT_CONSOLE_HOME=<dir> for the daemon and Console both: a daemon hides only ~/.viewport/console, $VIEWPORT_CONSOLE_HOME in its own environment and homes Console named when pairing with it, so for any other --home Console warns and does not pair this machine's daemon (console.home_unprotected). In every home but the default, the CLI's token can only read while Console runs, and so can its sign-in links |
--unprotected-home | Pair this machine's daemon anyway from a home it does not hide (serve, pair); the CLI's sign-in links still leave out approve |
--host <h>, --port <p> | Bind address for serve (default 127.0.0.1:7071; --port 0 picks a free port) |
--no-open | Do not open the browser |
--no-pair | Do not pair the local daemon on start |
--no-link | Print no sign-in link (what up uses, since its output goes to console.log) |
--json | Machine-readable output |
--name, --reply-url, --webhook, --allow-private, --scopes, --tenants | Arguments of sources add and tokens add |
Exit codes
| Code | Meaning |
|---|---|
| 0 | OK |
| 1 | An error from Console (the message names its console.* code), or a receipt chain that does not verify |
| 2 | Usage: an unknown command or flag, missing arguments |