Skip to content

Installation and first-time setup

Requirements

Item Details
Node.js 20 or later. Outbound connections through a corporate proxy (HTTPS_PROXY) need Node 22.21 or later (or 24.5 or later), see https-proxy.md. The CLI’s --no-wait and --no-claim use allowNegative from util.parseArgs, which needs Node 20.16 or later (or 22.4 or later)
Operating system macOS, Linux (needs lsof, ps, sh); Windows 10/11 natively (no WSL needed, see windows.md). On Windows devhub uses the built-in netstat, tasklist, taskkill and icacls
Orca CLI Optional. Worktrees always come from git worktree list, and devhub works fully without Orca; with Orca (orca on PATH, or set via ORCA_CLI_COMMAND), orca worktree list and orca repo list add project names. While devhub knows no repo yet, the admin UI still opens and lets you edit the config, the header’s “worktree source” pill turns orange and opens an explanation with the fix (plus a dismissible notice card), and services cannot start (see below)
glab Optional. Used to look up project display names from GitLab; if it is missing or the lookup fails, devhub falls back to the origin path name
Domain and DNS provider Needed only for the HTTPS proxy: the free DuckDNS if you have no domain, or Cloudflare if you have one hosted there; use the local CA only when you’re offline or your company network blocks outbound access. For the order and a comparison see https-proxy.md. Without proxy.host the proxy is off, everything else works as usual, and http://127.0.0.1:4999 stays available

There is a single runtime dependency, acme-client; everything else is built into Node.

Install and start

Pick one of two paths. To just use devhub, choose A; to change devhub itself, choose B.

The plugin is a complete copy of devhub (server, CLI, skill). The quickest way is npx @vantist/devhub install: it runs the official plugin install commands for Claude Code, Codex and Antigravity, whichever it finds on PATH (--dry-run only lists the commands); for manual installation and every command see agents.md. After that, from any directory:

終端機視窗
devhub server start # if there is no global devhub, use the CLI inside the plugin: node "<plugin directory>/bin/devhub.mjs" server start

server start first copies the server to runtime/<version>-<short hash>/ in the config directory (see the next section), then starts it in the background from the copy. If the plugin directory has no node_modules, it runs npm ci --omit=dev inside the copy (network required). It returns once the management API responds; if devhub is already running it reports where and which version, and does not start a second one. By default you start it manually; to start it automatically when an agent session begins, see agents.md.

B. Clone and run directly (working on devhub itself)

終端機視窗
git clone <repo-url> devhub
cd devhub
npm ci
node devhub.mjs

Both paths

  • Admin UI: http://127.0.0.1:4999 (bound to localhost only).
  • When proxy.host is set and HTTPS is ready, you can also reach it at https://<your-domain>/devhub/.
  • Fallback entry: if binding 443 fails (port in use, insufficient privileges) or certificate issuance fails, http://127.0.0.1:4999 still works. The Proxy pill in the header changes to “Proxy problem”; open it to see the cause and to “Rebind”.

Managing with the server command

devhub server manages “the server started from the directory this CLI lives in”. There is only one instance per machine (decided by the management API port and server.json), so even if Claude Code, Codex and Antigravity each have their own copy of the plugin, only one server runs.

Command Description
devhub server start Starts in the background (detached), writing output to server.log in the config directory; if already running, reports sourceRoot, runtimeRoot and version. --no-copy skips the copy and runs straight from this directory
devhub server status Whether it is running, pid, sourceRoot (plugin/clone), runtimeRoot (copy), version and uptime; suggests a restart when the source version is newer than the running one, the content changed, or the CLI moved to another directory. Exits 4 when not running
devhub server restart Stops, then rebuilds the copy from the directory of “this” CLI and starts again: needed only when the core changed (the update notice and server status say so; updates touching only the UI or CLI don’t need it); managed services are unaffected
devhub server stop Stops devhub itself only; the services it manages are detached from the devhub process and keep running
devhub server autostart [on|off] Turns automatic start at the beginning of an agent session on or off; off by default
devhub server token [on|off|regenerate|url] Optional token for the management API (off by default); url prints the web login URL, see development.md
devhub server proxy-admin [on|off] The /devhub/ admin entry on the proxy domain, on by default; off returns 404 and leaves only 127.0.0.1
  • The management API port defaults to 4999 and can be set with DEVHUB_URL (other ports and 443/80 use DEVHUB_PORT, DEVHUB_HTTPS_PORT and DEVHUB_HTTP_PORT, see configuration.md).
  • If binding 443/80 fails, start shows the reason, but the management API still counts as started.
  • When 4999 is held by a process that isn’t devhub, start/stop/status report an explicit error (exit 6) and never stop that process. Identification relies on /api/server returning devhub:true; timeouts and connection errors are retried (about 3 seconds in total). If there is still no response, the listener counts as devhub when its pid matches server.json or its command line runs devhub.mjs under the runtime or source directory; if neither holds, it exits 7 “cannot confirm (it may have just started)” rather than wrongly reporting the port as occupied. The cwd is not considered.
  • stop handles only the instance recorded in server.json: an instance started with node devhub.mjs straight from a clone has no record, so status shows “not started by the server command” with the pid, and stop refuses; end it yourself.
  • For the plugin directory, state (state.json, logs) lives in state/ in the config directory, so after a plugin version change restart still reconnects to the services already running; a clone keeps <clone>/.devhub/.

The server is tied to neither the session nor the plugin directory

  • Not tied to a session: server start launches detached (a separate session on POSIX), so ending the agent session or closing the terminal does not stop the server; use devhub server stop to stop it. For Windows see windows.md.

  • Not tied to the plugin/clone directory: while running, the server still reads files from its own root (src/ui/index.html, src/ui/tokens.css, frontend .mjs files, the icon, and acme-client when certificates are renewed). After a plugin update, Claude Code removes the old directory after 14 days, so server start copies to the location below first and then starts:

    Platform Location
    macOS/Linux ~/.config/devhub/runtime/<version>-<short hash>/
    Windows %APPDATA%\devhub\runtime\<version>-<short hash>\

    The copy contains the root devhub.mjs, src/, config/, package.json and node_modules; it excludes test, docs, site and .git. If the hash is the same the copy is reused rather than copied again; copying finishes in a temporary folder and is then renamed, so a half-finished copy is never started; old copies are kept only for the one in use and the previous one.

  • Run devhub server restart only for plugin updates that changed the core: the running server is still the old copy, and devhub server status and the hint at session start tell you; updates touching only the UI or CLI need no restart, see Does an update need a restart?.

  • Working on devhub itself: running node devhub.mjs inside a clone creates no copy; devhub server start --no-copy also runs straight from that directory.

Config file location

Personal settings are not kept in the repo; the default is ~/.config/devhub/services.json (%APPDATA%\devhub\services.json on Windows), and the environment variable DEVHUB_CONFIG can point to another path. Certificates, the audit log, claims, the token file and the server command’s files all live in the same directory (certs/, audit.jsonl, claims.json, cf.env, server.json, server.log).

On first start, if the config file does not exist, devhub copies the repo’s config/services.example.json to it (directory 700, file 600; on Windows icacls limits access to the current user) and shows a notice at the top of the UI. You can also create it yourself first:

終端機視窗
mkdir -p ~/.config/devhub
cp services.example.json ~/.config/devhub/services.json

All later changes (including edits in the UI) are written back to this file, atomically via a temporary file and rename. For the fields see configuration.md.

Repo list and worktree sources

Worktrees always come from git worktree list --porcelain; Orca only adds names. devhub knows repos from these sources, listing each path once:

Source What it is
repos in the config The permanent, named repo list (name → main checkout path); the name is the service’s repo field
Discovered When an agent calls devhub from a worktree (claim, start, status and so on), devhub records that repo under its folder name; a worktree a service has selected or runs from is recorded under the service’s repo name. Kept only in devhub’s state directory
Orca (optional) Adds project names and the worktrees Orca knows; worktrees Claude Code, Codex and others create with git come from git, and worktrees archived in Orca stay hidden
{
"repos": {
"my-app": "~/code/my-app",
"my-api": "~/code/my-api"
}
}

To save a repo to the list, open “⋯” → “Repo list” in the admin UI (press “Save to list” on a discovered repo, or enter the path of any directory in the repo), or run devhub repo add [path] [--name name] (MCP devhub_repo add). devhub repo list shows each repo’s source and whether the repo of the current directory is saved.

Repo list

git results are cached until .git changes (a worktree added or removed, a branch switched, a worktree directory deleted), so devhub does not run git every time; “Refresh worktrees” and devhub worktrees --refresh skip the cache. Add worktrees with git worktree add; they appear within 30 seconds. The git source has no Orca notion of “archived”, so a worktree disappears only after git worktree prune. The header’s “worktree source” pill says which source is in use (the green “worktree: git” is not an error; with Orca and everything fine it is hidden).

While devhub knows no repo at all (no Orca, no repos, and no agent has called it yet), the pill turns orange; open it for the reason and the fix. A dismissible notice card also appears the first time (remembered per browser, shown again when the reason changes). On Windows, a cmd “is not recognized as an internal or external command” message (in any language) is treated as orca being missing, and devhub shows its own localized explanation instead of the cmd text.

The worktree source pill and its explanation

Binding 443 and 80

Whether you need sudo depends only on the operating system, not on the certificate mode (DuckDNS, Cloudflare, local CA): macOS and Windows don’t, and Linux needs one of the settings below once. To compare certificate modes see https-proxy.md.

macOS: ordinary users may bind low ports on “all interfaces”, but not on 127.0.0.1 only. devhub therefore listens on all interfaces and rejects non-local sources at the connection layer; no sudo is needed.

Linux: ordinary users usually can’t bind ports below 1024. Pick one fix: sudo setcap cap_net_bind_service=+ep $(which node) (grants only this node), or sudo sysctl net.ipv4.ip_unprivileged_port_start=80 (relaxes it system-wide, lost on reboot; to make it permanent put it in /etc/sysctl.d/); or use high ports via DEVHUB_HTTPS_PORT/DEVHUB_HTTP_PORT, which needs no sudo but puts the port in the URL (for example https://<your-domain>:8443/). When binding fails, both the UI’s Proxy pill and devhub proxy status show these two approaches.

Windows: see windows.md.