Skip to content

Terminal output

Identify which service produced a message and give scripts predictable output without terminal decoration. devhost writes for people by default and for agents and scripts with AGENT=1. Agent mode can include extra diagnostic fields. Exit codes are the same in both modes.

A running stack prints its own messages and every service’s output. Each line starts with a bracketed tag naming who it is about:

  • [web]: a service, for its URLs, health checks, restarts, and shutdown.
  • [hello]: the stack itself, by the manifest’s name, for reloads, worktree switches, and Stack stopped.
  • [devhost]: anything else, such as messages before the manifest is read.
  • [web:48211]: a line that concerns one process adds its PID. Every line a service prints carries its process’s PID; so do detached starts, stops, and agent-mode restart diagnostics.

A file or existing-port devhost serve session uses serve- followed by its --domain value, such as serve-notes.localhost. A command session uses its generated <name>-<session-id> label, and child output uses command. See command sessions for naming and port discovery.

After the tag, every line carries a level: ERROR, WARN, or INFO. devhost’s INFO and WARN lines go to stdout, and its ERROR lines go to stderr. A line your service printed keeps the stream the service wrote it to and takes its level from that stream: INFO for stdout, ERROR for stderr. devhost cannot read how serious the line is, so a program that logs progress to stderr shows it as ERROR.

For people (AGENT unset or 0), tags and levels form aligned columns:

[hello] WARN managed caddy local CA is not trusted, so browsers will reject devhost HTTPS certificates.
[web:48211] INFO listening on :3000
[api:48230] INFO listening on :4000
[web] INFO https://hello.localhost (primary)
[api] INFO https://api.hello.localhost
[api] ERROR Exited with code 1; devhost is waiting for a restart.
  • Each name keeps the same color on every run, and the names in one stack get different colors; a service’s stdout and stderr share it. ERROR, WARN, and INFO have colors of their own. Colors appear only on a terminal: a non-empty NO_COLOR, TERM=dumb, or redirected output turns them off. A detached stack’s log has none.
  • The tag column leaves room for a PID, so a name’s lines line up with or without one. Lines are not wrapped; your terminal wraps long ones.

For agents (AGENT=1, true, or yes), each line is the tag, the level, and the message, separated by single spaces, without padding or colors:

[web:48211] INFO listening on :3000
[web] INFO https://hello.localhost (primary)
[api] ERROR Exited with code 1; devhost is waiting for a restart.

Your services’ output keeps its content apart from the tag. Invalid UTF-8 bytes display as replacement characters without stopping subsequent lines.

A foreground devhost start whose terminal stops reading, such as one suspended with Ctrl-Z, gets the newest 1 MiB of its stack’s output, at most 16,384 lines, when it reads again. Older lines are dropped for that terminal only, and the first line it prints counts them: [devhost] WARN Skipped 4810 lines (962000 bytes) of output while this terminal was not reading. The stack, other stacks, and the browser’s log panel keep every line.

AGENT=1 changes more than logs:

  • Help becomes compact key: value text listing every command below the one you asked about, and starts with a line telling the agent to read devhost skill.
  • Errors print the complete error as [devhost] ERROR lines. For people they print a short summary instead, often followed by an INFO hint.
  • Caddy’s certificate prompt is never shown; devhost prints a warning naming devhost caddy trust instead.
Terminal window
$ devhost star
[devhost] ERROR unknown command "star" for "devhost"; did you mean "stack" or "start" or "stop"?
[devhost] INFO Run "devhost --help" for usage.
$ AGENT=1 devhost star
[devhost] ERROR unknown command "star" for "devhost"; did you mean "stack" or "start" or "stop"?

A failed command writes its error and hint to stderr, as does the log tail of a failed devhost start --detach and Caddy’s diagnostics from a failed devhost caddy command. Manifest warnings also go to stderr, so they never mix with the results of a command such as devhost service list. Paths under your home directory are shortened to ~/ in devhost’s own messages. Output meant for other programs carries no tags and is identical in both modes: devhost stack list, stack find, stack info for agents, service list, --version, completion scripts, and devhost caddy print-root-cert, which also keep absolute paths.

In human mode, devhost restart and devhost stack restart print one row per restarted or retired stack. A restarted stack shows its URLs, one per line. Stacks with the same name include the distinguishing part of their project directory in parentheses. A stopped stack shows the reason, such as Manifest removed. The batch ends with Services may still be starting. if any replacement registered. A service that discovers its routes during startup can gain URLs after the summary prints.

With AGENT=1, progress and completion lines include the original and replacement supervisor PIDs and versions, project directory, and restart log path.

Instance summaries use devhost [<version>] for the stack or serve session’s supervisor. For a stack that cannot supply its version, the summary uses devhost [unknown]. devhost --version reports the executable you invoked.

Lines Caddy writes are tagged [caddy] and keep Caddy’s own level: its warnings as WARN, its errors as ERROR, and lines without a level as INFO. devhost’s own messages about Caddy are tagged [devhost].

  • Successful route changes print nothing; devhost start --debug shows them.
  • After a command succeeds, devhost shows only Caddy’s warnings and errors. After a failure it shows everything else too.
  • Security warnings, including unprotected on-demand TLS, are shown even when the command succeeds.
  • devhost leaves out lines it reports itself or that no setting of yours can change: Caddy’s start confirmation, notes about the Caddyfile devhost generates, and trust-store notices such as not NSS security databases found or define JAVA_HOME environment variable to use the Java trust, which only mean there is no Firefox or Java trust store to update.

Caddy’s full log stays in <state>/caddy/caddy.runtime.log; see Files and directories.

devhost start --detach prints its own lines tagged with the stack’s name; the stack’s output goes to its log. When the stack is ready, or already running, it writes to stdout and exits 0:

LineMeaning
[hello:48211] INFO devhost [1.2.3] · Started.The stack is ready: every started service passed its health check and its routes are registered. One line per URL follows, such as https://hello.localhost, in the order the manifest lists the services.
[hello:48211] INFO devhost [1.2.3] · Already running.A stack from the same manifest was already running in the requested local or remote mode, so nothing was started.
[hello] INFO Log: ~/.local/state/devhost/logs/stack-<sha256>.logThe file the stack’s output is appended to; see Files and directories. Left out when the running stack was started in the foreground, which has no log.

With remote routing selected automatically by machine configuration or explicitly with --remote, readiness also requires a connected relay, and both a new start and an already-running remote stack print public HTTPS URLs. This does not verify public DNS or gateway authentication. A repeat requesting a different local or remote mode fails and asks you to stop the existing stack first.

A failed start writes to stderr and exits 1. Its last line names the cause and the full log. When the command launched a stack that then failed or that it stopped, it first prints Startup log tail: and up to the last 30 lines this start wrote to the log, as the stack wrote them. The [api] lines below are the stack’s own, from the log; the last three are the command’s:

Terminal window
$ devhost start --detach
[devhost] INFO Startup log tail:
[api:48230] INFO listening on :4000
[api] INFO Waiting for the service to pass its HTTP health check on http://127.0.0.1:4000/healthz (elapsed: 2s; timeout: 3s)...
[api] ERROR Service api did not pass its health check within 3000ms. HTTP health check for http://127.0.0.1:4000/healthz did not receive a response before the startup deadline. Check the app's startup logs and services.api.health.http. Stopping the service because its startup health check failed; sending SIGTERM (signal 15).
[devhost] ERROR Service api did not pass its health check within 3000ms. HTTP health check for http://127.0.0.1:4000/healthz did not receive a response before the startup deadline. Check the app's startup logs and services.api.health.http.
[devhost] ERROR service api did not become ready
[devhost] INFO Read the full log in ~/.local/state/devhost/logs/stack-<sha256>.log.

With AGENT=1 the last line holds the cause and the log together:

[devhost] ERROR service api did not become ready; full log: ~/.local/state/devhost/logs/stack-<sha256>.log
CauseMeaning
service api did not become readyA started service failed to launch, failed its health check, or exited before the stack was ready. The log tail shows its error.
the stack exited before it was ready (exit code 1)The stack stopped before any service failed, for example because another stack holds one of its manifests, hostnames, or fixed ports. The log tail shows why.
the stack was not ready within 2m40sStartup ran out of time; see Keep a stack running after the terminal closes for how long it gets.
received SIGINT (Ctrl-C) (signal 2) before the stack was readyYou pressed Ctrl-C while the command waited. SIGTERM and SIGHUP, which closing the terminal sends, name themselves the same way.
another start of this manifest did not finish within …, received … while another start of this manifest was runningThe command ran out of time, or got a signal, while it waited for another detached start of the same manifest: one still starting, or a failed one whose stack was still stopping. This start launched no stack, so no log tail is printed.
the stack supervisor could not be launched: …devhost could not run its own executable in the background. No log tail is printed.

When the stack’s cleanup takes longer than the command waits for it, or a signal received during that wait ends it (after a signal canceled the start, that takes another one), the cause ends with ; the stack (PID 48211) is still stopping, and the hint for people adds Run "devhost stack list" to see when it has stopped. Starting the manifest again waits until that stack has stopped.

When devhost cannot prepare the start in its state directory, the command fails before it launches anything, so there is no log tail. The cause names the step: the stack log directory could not be created, the start lock could not be opened, the running stacks could not be read, the failure record of the previous start could not be removed, the stack log could not be opened, or the stack log could not be read. People get a hint naming the state directory; with AGENT=1 the line adds the system’s error, such as the stack log could not be opened: open …/stack-<sha256>.log: permission denied. devhost could not find its own executable also fails before anything is launched; its hint suggests running devhost start without --detach.

On systems other than Linux and macOS the command fails at once with devhost start --detach runs on Linux and macOS, not <system>. For people, an INFO hint suggests running devhost start without --detach.

devhost stack info queries the running stack’s live state from the manifest directory or any subfolder (or --manifest <path>). It works for both foreground and detached stacks, even when every devtools feature is disabled.

For people (AGENT unset or 0), it prints a concise summary header, one aligned row per service with its live state and URLs (or (no route)), the last output line below an exited or failed service, and the home-shortened log path for detached stacks:

devhost [1.2.3] · Acme Shop · degraded · PID 8519 · detached · up 12m
web (primary) ready https://shop.acme.localhost
api exited 1 https://shop.acme.localhost/api/
└ fatal: lost connection to the payments database
worker ready (no route)
Log: ~/.local/state/devhost/logs/stack-<sha256>.log

For agents (AGENT=1, true, or yes), it prints stack and service key-value lines, without tags, with the running supervisor’s version (or unknown), absolute manifest, included manifest, and log paths, the control port, creation time, and per-service state, primary flag, exit code, state timestamp, port, URLs, and last output line for exited or failed services:

stack name="Acme Shop" version=1.2.3 pid=8519 mode=detached ready=false manifest=/abs/devhost.toml manifestFiles=/abs/devhost.toml,/abs/admin/devhost.toml controlPort=41231 log=/abs/stack-<sha256>.log createdAt=2026-11-20T14:01:02Z
service name=web state=ready primary=true since=2026-11-20T14:01:05Z port=22250 url=https://shop.acme.localhost
service name=api state=exited exitCode=1 since=2026-11-20T14:01:53Z port=22310 url=https://shop.acme.localhost/api/ last="fatal: lost connection to the payments database"
service name=worker state=ready since=2026-11-20T14:01:05Z

devhost stack info exits 0 after startup completes and every started service is ready. Live health checks run together with a one-second budget. A check that times out reports its service as unhealthy alongside the rest of the stack. Services omitted by a partial start report not-started and are excluded from readiness. The command exits 1 while the stack is starting, when a started service is unready, or when it cannot query a running stack for the manifest.

MessageMeaning
[web] INFO https://app.localhost (primary)A service’s URL, printed once it starts. One line per URL.
not started: admin, docsServices left out because you named others on devhost start.
configuration reloaded: devhost.toml, …A saved manifest edit was applied. See Hot reload.
configuration reload rejectedA saved edit was invalid; the stack keeps running as it was.
Received SIGINT (Ctrl-C) (signal 2); shutting down the stack.Printed at once on the first shutdown signal; SIGTERM and SIGHUP name themselves the same way.
[web] INFO Stopping service... / [web] INFO Stopped service.Shutdown progress for each service.
Stack stopped.Every service and route was cleaned up. Wait for this line before assuming the stack is gone.
... sending SIGTERM (signal 15)devhost is stopping a service that failed its health check. A following Exited with code 143 is that stop.
[devhost:PID] INFO Stopping zombie ... (or ... zombie stack ...)A leftover process or hosted stack from an earlier run is being cleaned up. See Zombie cleanup messages.
Idle timeout of 1h reachedThe idle timeout is stopping the stack.
[devhost] WARN Skipped 4810 lines (962000 bytes) of output ...This terminal stopped reading, for example after Ctrl-Z, and missed that much of its stack’s output. See Stack logs.