Run it locally for a first try
Start VCode on your own machine with one command and open it in a
browser. node scripts/remote-dev.js runs the whole stack on loopback: a fake
login site, a test router, one box linked to a dev account, and the app build.
A box serves no page of its own, from a clone or from a release. The app is the only way in, so a first try needs the app and a site to log in on; this script fakes the site and the router so nothing leaves the machine.
Why you would use it
You cloned the repo and want to see the app before deciding to install it. You
are changing the code and need the app and a box you can restart. You want to
check that your claude, codex or opencode CLI is wired up before putting
the app on a phone.
How to use it
- Install node 24 or newer.
install.shrefuses anything older (node >= 24 required), andpackage.jsondeclares"node": ">=24". - Install at least one agent CLI (
claude,codexoropencode) so it is on yourPATH. VCode spawns them by name. - Install the dependencies:
npm install(the app build needs the dev ones). - Run
node scripts/remote-dev.js. It builds the app intodist/appand prints its URL, the fake site's, the router's and a control URL. - Open the app URL and tap Log in. The fake site's page asks for the email
(
dev@example.testunless you passed--email) and a code, which the script prints as[site] login code for dev@example.test: <code>. The page sends you back to the app, logged in, with the boxdev-boxlisted.
--boxes N links N boxes to the same account. Ctrl+C stops everything and
removes the state under /tmp.
To run a box on its own, without the app: export AUTH_TOKEN=$(openssl rand -hex 32),
then npm start (which runs node server.js). It answers / with a page that
points at app.fezu.dev, /health, and the API for a caller that sends the
token, such as npm run smoke. For development,
npm run dev restarts it by port rather than by process name, and binds the
tailnet IP when tailscale ip -4 answers. With no AUTH_TOKEN set it makes a
token once and keeps it in ~/.v-code/dev-token (mode 0600).
What you see
On startup the box writes two lines to stdout:
VCode on http://127.0.0.1:3444/state /home/you/.v-code/threads
Without AUTH_TOKEN it prints one line on stderr and exits 1:
[v-code] refusing to start: AUTH_TOKEN is empty. VCode runs agents with permissions bypassed, so every request needs the token. Set one: AUTH_TOKEN=$(openssl rand -hex 32) npm start, or run \bash install.sh install`, which writes one to ~/.config/v-code/env.`
The token is never printed. If the port is taken, the server prints
port 3444 is already in use; another VCode server is running. followed by
find it: ss -ltnp 'sport = :3444' replace it: npm run dev, and exits 1.
remote-dev.js runs its boxes on free ports with their own tokens, so it does
not clash with a box already on 3444.
Options and settings
| Option | Default | What it changes |
|---|---|---|
VCODE_PORT |
3444 |
The port server.js listens on |
BIND_HOST |
127.0.0.1 |
The address it binds. A tailnet IP makes it reachable from the tailnet, and closes loopback |
AUTH_TOKEN |
(none) | The bearer token for the CLI and scripts. Required: without it the server does not start |
VCODE_DEFAULT_CWD |
the home folder | The folder a new thread starts in; Set as default in the new-thread card overrides it |
VCODE_ENABLE_MOCK_AGENT |
(off) | Adds a scripted mock agent. For tests only |
npm run dev also reads VCODE_LOG (default /tmp/v-code-<port>.log)
and VCODE_UNIT (no default: with none set it restarts by port). The server
and npm run dev still read the old WORKBENCH_* names; the new name wins
when both are set.
Limits and known gaps
- Anyone with the token runs commands as you: agents run with approvals bypassed. See trust-model-and-security-headers.
BIND_HOST=0.0.0.0publishes the box's API on your wifi LAN as well as the tailnet.- The fake site sends no mail and checks nothing a real login would. It is for this machine only; a phone uses the real app on app.fezu.dev (use-the-app).
- The boxes
remote-dev.jsstarts run Claude, Codex and the scripted Mock agent, not the OpenCode or Cursor CLI.
Related
- install-as-systemd-units: make it survive a reboot
- use-the-app: the app this page fakes the site for
- environment-variables: every variable the server reads
- start-a-thread: the first thing to do once it is up
- the-three-agents: which CLI VCode spawns