Quickstart
Run a daemon and Console from source, pair them, watch a session live, and answer approvals from the inbox.
Before you start
- Node 22.13 or later to run Console, 22.18 or later to build it. Console runs on 22.13 or later (it uses
node:sqlite, and an older Node stops at once withConsole needs Node 22.13 or later for node:sqlite; you have 22.12.0), but building it from source needs 22.18 or later, which the build tools require. - Do not put homes in a temp directory. Console refuses a home under
/tmpor$TMPDIR(console.home_invalid): agents the daemon runs can write there. The~/vpc-tryand~/.viewport/vpd-tryhomes below are fine. - corepack on Node 25 and later. Node 25 and later don't include corepack: run
npm install -g corepackfirst, or install pnpm directly. (The build tools accept Node 22.18+, 24.11+ and 26+, not 25.) - From source. To just use Console, run
npm install -g @viewportai/console @viewportai/daemon. The commands below run from a source checkout, built with the README's From source steps, from thatconsole/checkout. - The daemon. The daemon commands come from
@viewportai/daemon0.32.0 or later, or from the daemon built in the same steps. Earlier 0.31.x releases are a different daemon with a different CLI. Nothing below needs an API key.
Both CLIs run from the source builds through aliases.
From console/, in the sibling layout from the Install steps:
DAEMON=$PWD/../daemon
alias viewport-console="node $PWD/packages/console/dist/cli/bin.js"
alias viewport-daemon="node $DAEMON/dist/cli/bin.js"Throwaway homes keep an existing setup untouched: VIEWPORT_HOME is the daemon's home (Console reads it too, to
find the daemon on this machine), and VIEWPORT_CONSOLE_HOME is Console's. Export both before starting either: a
daemon hides Console's home from its agents only where it knows to look, which is ~/.viewport/console,
$VIEWPORT_CONSOLE_HOME in its own environment, or a home Console named when pairing with it. So the daemon you
start below hides both homes from its agents. (A --home the daemon does not hide makes Console warn and skip
pairing this machine's daemon.) Console's home can't be inside the current folder either: agents work there and
can write to it, so Console refuses it with console.home_invalid. The daemon's throwaway home sits under
~/.viewport, which no daemon ever allows as a session's working directory or as a place agents may write.
The export protects these homes from the daemon started here, not from daemons you already run: those were started
without it. Daemons of this release register their homes and keep each other's agents out of them, but they still
read Console's home, and an older daemon reads both: their agents can read ~/vpc-try (Console's keys and CLI token) and ~/.viewport/vpd-try (this
daemon's owner token, identity and peers; ~/.viewport keeps agents from writing there, not from reading). Do not leave untrusted agents running under other daemons while you try this, and
delete both homes after (step 5). Because of this, in any home but the default, Console gives the CLI's sign-in
links (viewport-console open) and the CLI's token itself read only, and you act in the session serve opens. The default
home, ~/.viewport/console, is the only one every daemon hides.
1. Start the daemon
export VIEWPORT_HOME=~/.viewport/vpd-try VIEWPORT_CONSOLE_HOME=~/vpc-try
viewport-daemon up --direct 127.0.0.1:0
# Started the daemon (pid 13405); log /Users/you/.viewport/vpd-try/daemon.log.
# Daemon running (pid 13405)
# ID vpd_hvlyqpmxo46vq2yhw6btocyzs3
# Name Mac
# Version 0.32.0
# Home /Users/you/.viewport/vpd-try
# Socket /Users/you/.viewport/vpd-try/daemon.sock
# Direct ws://127.0.0.1:53804/v1/connect
# Relay off
# Isolation home
# Stop sweep kernel
# Approvals paired controllers only
# Pairing pair over the local socket
# Runners command, claude-code (unavailable: needs a login token, run `viewport-daemon claude-token`)Isolation home means every agent runs in the OS sandbox, which hides the daemon's home and Console's home from it.
Without Claude Code installed, Runners lists only command; with it installed but not logged in for sandboxed
sessions, a warning follows that says how to log in (see step 3).
--direct 127.0.0.1:0 picks a free port, so it never collides with a daemon you already run on 7070.
viewport-daemon status shows it again; Console finds it on its own.
2. Start Console and pair the daemon
In the same shell (so both homes are set):
viewport-console serve --port 0
# Viewport Console http://127.0.0.1:53817
# Paired this machine's daemon Mac vpd_hvly qpmx o46v q2yh w6bt ocyz s3 controller
# Undo: viewport-console daemons rm <id>, or run with --no-pair.
# warning: This machine's daemon verified that it hides Console's home (/Users/you/vpc-try) from its agents. ...
# Sign in: opened in your browser (single use). `viewport-console open --no-open` prints another link.--port 0 picks a free port too; the first line shows it. serve signs you in by opening your browser with a
single-use link that lasts 10 minutes and carries every permission, approving included; it goes only to this
terminal, never to disk. With --no-open it prints the link instead
(Sign in: http://127.0.0.1:53817/login#t=...). The warning says that only this daemon confirmed it hides the home,
so other daemons' agents could read it: for another link later, viewport-console open in a shell with the same
export (add --no-open for a link to paste elsewhere) signs in read only. Approve in the session
serve opened. On start
Console reads the daemon's owner token (0600, owned by you), asks it over its local socket for a single-use offer,
checks the offer's key against the daemon's hello, and redeems it. Console then holds a controller pairing,
never the owner token. Node may also print an ExperimentalWarning for node:sqlite; it is harmless.
3. Watch a session live
In a second shell (set the aliases and the same export again), from a throwaway folder:
mkdir -p ~/vp-demo && cd ~/vp-demo
viewport-daemon start command -- npm --version
# ses_01M8KTHACK1AYWEEMSAYC0K47WA session's working directory defaults to the current one, and an agent can write anywhere under it. Never start
sessions in Console's checkout: it holds the code Console runs (dist/, node_modules) and its web UI, so a
session there could change what Console runs on its next start. viewport-console doctor names Console's install
and says that no daemon protects it from agent writes yet.
It prints the session id, and the session shows up live in Console's Sessions. A command session only streams
its output: that runner never asks for approval. Approvals come from agent sessions, such as claude-code below.
Optional, for a coding agent: viewport-daemon start claude-code "fix the failing test", run from your project (or
~/vp-demo, never Console's checkout), needs Claude Code installed.
Sandboxed sessions need their own login: run claude setup-token, then viewport-daemon claude-token and paste
the token (or set ANTHROPIC_API_KEY for the daemon). Without one, the daemon says exactly that. When an agent asks
to run a tool, the approval lands in the Inbox.
4. The same from code
Every flow above is also a runnable example; make examples runs them all with scripted agents, real daemons and a
real Console in one process. Pairing this machine's daemon and streaming a session:
const app = await createConsole({
home: false, // in memory for the example; the CLI uses ~/.viewport/console
config: { daemon: { home: daemonHome, local_direct_url: daemon.directUrl } },
});
const listening = await app.listen({ port: 0 });
const paired = await app.daemons.pairLocal();
console.log("Paired", paired.daemon.name, paired.daemon_fingerprint.join(" "), paired.daemon.role);const { token } = await app.tokens.create("example", ["read", "control"]);
const vc = await connect({ url: listening.url, token });
// The agent's own working folder: it may write anywhere under its cwd, so never Console's checkout.
const session = await vc.sessions.start(paired.daemon.daemon_id, { runner: "agent", cwd: workdir });
const live = await vc.live();
const stream = await live.subscribe({ topic: "session", daemon_id: session.daemon_id, session_id: session.id });
const said: string[] = [];
for await (const message of stream) {
if (message.type !== "event") continue;
if (message.event.type === "message") said.push(message.event.content);
if (message.event.type === "status" && message.event.status === "exited") break;
}
live.close();
console.log("Agent said:", said.join(" "));Answering an approval with a named token that holds the approve scope (answers are recorded as
console:token:<name>), then verifying Console's receipt chain:
const vc = await connect({ url: listening.url, token });
for await (const item of vc.inbox.watch()) {
// Answer only the call this bot exists for; any other item (another session, daemon or gate) waits for a person.
if (item.session?.session_id !== session.id || item.action.tool_name !== "Bash") continue;
console.log(`${item.source.name} asks: ${item.action.tool_name}`, JSON.stringify(item.action.args));
const result = await item.approve({ reason: "Release checklist done" });
console.log("Answer:", result.outcome, result.item.status, "by", result.item.decision?.by);
break;
}const final = await until(async () => {
const { session: s } = await vc.sessions.get(session.daemon_id, session.id);
return s.status === "exited" ? s : undefined;
});
const receipts = await vc.receipts.list();
const verified = await vc.receipts.verify();
console.log("Session", final.status, "| receipts:", receipts.map((r) => r.kind).join(", "));
console.log(`Verified ${verified.count} entries, head ${verified.head?.digest}`);From Python, a HITL gate answered in Console: see Answer HITL approvals.
5. Clean up
# Ctrl-C in the serve shell stops Console (viewport-console down stops one started with `up`)
viewport-daemon down
rm -rf ~/vpc-try ~/.viewport/vpd-try ~/vp-demoA home other than the default keeps Console's keys in files inside it, so deleting the folder removes
everything. (Older versions put them in the OS keychain; viewport-console forget --home <dir> removes such
leftovers.)