Skip to content

CLI

Find the command or flag to start, inspect, stop, or script your development stack. This reference lists every devhost command, flag, and environment variable. Run any command with --help for terminal help; devhost caddy, devhost service, devhost stack, and devhost completion list their subcommands when run alone.

CommandDoes
devhost start [service-or-group...]Starts the stack of the nearest devhost.toml and keeps running in your terminal; with --detach, returns once the stack is ready and leaves it running. With names, starts only those services or groups, their dependencies, and alwaysStart services.
devhost stopStops the stack of the nearest devhost.toml. Waits 15 seconds, then kills what is left.
devhost stack infoShows this project’s running stack: name, run state, PID, foreground or detached mode, live per-service state and URLs, and fuller key-value details under AGENT=1. Works from the manifest folder or any subfolder; exits 0 only when every started service is ready. See Stack info.
devhost stack listPrints every running manifest-backed stack: PID, a tab, and the absolute manifest path, sorted by path.
devhost stack find <query>Prints the stacks whose hostname matches a URL exactly, or whose hostname, name, or manifest path contains the query (ignoring case). A path to a manifest file also matches the stack started from that file through a symlink. Same format as stack list.
devhost stack restart [--all]Restarts the running stack for the nearest devhost.toml using this executable. Preserves the launch selection. See Restart after upgrading.
devhost restartReplaces all running manifest stacks and standalone serve sessions in the selected state directory using this executable. Works from any directory.
devhost service listPrints the manifest’s service names, one per line, sorted.
devhost serveLaunches a command or serves a folder or running local server over HTTPS without a manifest.
FlagCommandsMeaning
--manifest, -m <path>start, stop, service list, stack info, stack restartThe devhost.toml to use instead of the nearest one. Also DEVHOST_MANIFEST; the flag wins. Any path to the file, including through a symlink, names the same running stack.
--idle-timeout, -i <duration>startStop the stack after this long without activity, such as 30s or 1h. Also DEVHOST_IDLE_TIMEOUT; the flag wins, and both win over the manifest. See Stop automatically when idle.
--detachstart, serveFor command-mode serve, wait for the first HTTP route and print its session, URLs, log, and stop command; each launch is independent. For start, launch the stack in a session of its own, wait until every started service passes its health check and its routes are registered, then print its PID, URLs, and log file and exit. Repeating it while the stack runs in the same local or remote mode reports that stack. In remote mode, readiness also requires a connected relay. No short flag: -d is command-specific. Linux and macOS only; other systems reject it. See Keep a stack running after the terminal closes.
--remote, -rstartRequire the configured remote relay. Ordinary startup already uses [remote] when present; missing enrollment or a connection failure is an error. Mutually exclusive with --local.
--local, -lstartForce local routing, using top-level machine domainSuffix (default .localhost) for short service labels. Mutually exclusive with --remote.
--debug, -dstartShow Caddy’s output for every route change.
--worktrees, -wstopStop every stack whose root manifest is in this Git repository, including linked worktrees.
--all, -astack restartRestart the whole stack for the nearest manifest. Omit --all when using --manifest or DEVHOST_MANIFEST.
--startable, -sservice listLeave out alwaysStart services, which start whether or not you name them.
--domain, -d <hostname>serveRequired for files or an existing port; command mode generates hostnames.
--dir <path>serveFolder to serve; defaults to the current directory.
--port, -p <port>servePort of a running HTTP server on 127.0.0.1. Cannot be combined with --dir.
--name <name>, -n <name>serveOverride the inferred command app name; retain the session ID.
--startup-timeout <duration>servePositive duration to wait for the first HTTP listener; default 30s.
--session <name>stop, stack infoSelect a manifest-free serve session. Overrides manifest discovery and DEVHOST_MANIFEST; incompatible with explicit --manifest and with stop --worktrees.
--sessionsstack listList serve sessions as PID, tab, name instead of manifest stacks.
CommandDoes
devhost caddy downloadDownloads the Caddy binary devhost manages. Without it, devhost uses the caddy on your PATH.
devhost caddy startStarts the shared Caddy in the background, and installs its certificate authority when the system does not trust it yet.
devhost caddy stopStops the shared Caddy.
devhost caddy trustInstalls Caddy’s certificate authority into the system trust store. Asks for your password, or reports that it is already trusted.
devhost caddy trust-remote <ssh-target>macOS: fetches another machine’s Caddy root certificate over SSH, prints its fingerprint, and installs it into the System keychain.
devhost caddy print-root-certPrints Caddy’s root certificate in PEM form.
devhost caddy privileged-portsLinux: lets the managed Caddy bind ports below 1024 without root, using setcap. Downloads Caddy first if needed.

See Route apps over HTTPS for how these fit together.

CommandDoes
devhost --version, -vPrints the version.
devhost skillPrints how to install the devhost skill for AI coding agents.
devhost skill install <dir>Uses Git to install the guide and companion files in <dir>/devhost. Creates missing parents, rejects an existing destination, and prints the installed path.
devhost completion bash|zsh|fish|powershellPrints a shell completion script. --no-descriptions leaves out command descriptions; devhost completion <shell> --help says where to install it.

Load completions for the current shell session:

Terminal window
source <(devhost completion bash) # needs the bash-completion package
source <(devhost completion zsh) # after compinit
devhost completion fish | source

In PowerShell, run devhost completion powershell | Out-String | Invoke-Expression. Regenerate installed scripts after upgrading devhost so they include the current commands and flags. Invalid arguments exit 1, write diagnostics to stderr, and point to command help.

CodeWhen
0Success. devhost stop with no stack running, devhost stack find with no match, and devhost start --detach with the manifest’s stack already running in the same local or remote mode also exit 0.
1, or the exit code of a tool devhost ranThe command failed; the error says why. A devhost start --detach interrupted by a signal, or devhost stack info when no stack runs or any started service is not ready, also exits 1.
130A foreground stack or devhost serve session stopped by Ctrl-C.
143A foreground stack or devhost serve session stopped by SIGTERM.

A stack that cannot stop all of its services exits non-zero and lists what is still running.

devhost stack info inspects the stack resolved from the current directory, --manifest, or DEVHOST_MANIFEST, including a path to an included manifest. Services that were deliberately left stopped do not make the stack unready. A service that is starting, restarting, unhealthy, or exited makes the command exit 1.

These change how devhost itself behaves. For the variables devhost passes to your services, see Environment variables.

VariableEffect
AGENT1, true, or yes switches every command to output for agents and scripts.
DEVHOST_MANIFESTSupplies the manifest path for commands that take --manifest.
DEVHOST_IDLE_TIMEOUTSame as --idle-timeout.
DEVHOST_STATE_DIRThe state directory. Each state directory has its own Caddy and its own set of stacks.
XDG_STATE_HOMEThe state directory becomes $XDG_STATE_HOME/devhost when DEVHOST_STATE_DIR is unset.
DEVHOST_CONFIG_DIRThe folder holding config.toml.
XDG_CONFIG_HOMEconfig.toml is read from $XDG_CONFIG_HOME/devhost when DEVHOST_CONFIG_DIR is unset.
NO_COLORAny non-empty value turns off the colors devhost adds. TERM=dumb does too.
COLUMNSTerminal width for wrapping log lines, used when devhost cannot read the terminal’s size.
DEVHOST_DEV_SOURCE_DIRDevelopment only: the devhost source checkout to serve the toolbar from. See Build from source.

devhost reads only the environment it is started with; it does not load .env files.

PathHolds
~/.config/devhost/config.tomlMachine-wide settings, such as Caddy’s ports. Moved by DEVHOST_CONFIG_DIR or XDG_CONFIG_HOME.
~/.local/state/devhost/The state directory: records of running stacks, hostname and port claims, and Caddy’s data. Moved by DEVHOST_STATE_DIR or XDG_STATE_HOME.
<state>/caddy/caddy.runtime.logCaddy’s log, rotated automatically.
<state>/caddy/caddy.stdout.log, caddy.stderr.logCaddy’s output from its last start.
<state>/daemon.json, <state>/run/daemon-<pid>.sock, <state>/daemon.logPrimary shared supervisor metadata, its private 0600 Unix RPC socket inside a 0700 directory (falling back to a private per-user temporary directory when the state path is long), and append-only supervisor diagnostics. daemon.json and the socket are created on demand and removed automatically when the last stack stops; daemon.log is retained for troubleshooting.
<state>/tmp/Private 0700 scratch space for running stacks: chat history files, which are unlinked as soon as they open, and the cursor state of open agent activity streams. Stacks keep these here, not in the system temporary directory, because the shared supervisor outlives the shell that started it and that shell’s temporary directory can be removed.
<state>/logs/stack-<sha256>.logThe output of the stacks devhost start --detach starts from one manifest, named after the SHA-256 of the manifest’s path with symlinks resolved. Each detached start appends to it, and only your user can read it.

config.toml lives under ~/.config on macOS too. Stacks with different state directories never see each other.