Skip to content

CLI

Every devhost command, flag, and environment variable. Run any command with --help for the same information in your terminal; devhost caddy, devhost service, devhost stack, and devhost completion print their subcommands when run alone.

CommandDoes
devhost start [service-or-group...]Starts the stack of the nearest devhost.toml. 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 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). Same format as stack list.
devhost stack restart [--all]Restarts this project, or every stack and serve session in the same state directory, using this executable. Preserves launch arguments, working directory, and environment; replacements run in the background with printed private log paths. See Restart after upgrading.
devhost service listPrints the manifest’s service names, one per line, sorted.
devhost serveServes a folder or a running local server over HTTPS without a manifest.
FlagCommandsMeaning
--manifest, -m <path>start, stop, service list, stack restartThe devhost.toml to use instead of the nearest one. Also DEVHOST_MANIFEST; the flag wins.
--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.
--detachstartWait for readiness, then leave the stack running independently of the caller. Linux and macOS only; see Detached startup.
--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 all manifest stacks and standalone serve sessions in this state directory. Cannot be combined with --manifest or DEVHOST_MANIFEST.
--startable, -sservice listLeave out alwaysStart services, which start whether or not you name them.
--domain, -d <hostname>serveRequired. The hostname to serve.
--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.
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 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
CodeWhen
0Success. devhost stop with no stack running, and devhost stack find with no match, also exit 0.
1, or the exit code of a tool devhost ranThe command failed; the error says why.
130A foreground stack or devhost serve stopped by Ctrl-C.
143A foreground stack or devhost serve stopped by SIGTERM.

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

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_MANIFESTSame as --manifest. Ignored by devhost serve.
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.

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