denvig services
The services command manages background services defined in your projects.
Services are long-running processes such as web servers, databases, or workers.
Denvig supervises them with launchctl, keeps their logs, and can route them
through the gateway on a custom domain.
denvig services <subcommand>Global options
Section titled “Global options”| Option | Description |
|---|---|
--project |
The project slug to run against. Defaults to the current directory. |
--json |
Output in JSON format. |
Subcommands
Section titled “Subcommands”List the current project’s services, with each worktree’s services nested beneath it:
denvig services list| Option | Description |
|---|---|
--all |
List services across all projects and global services. |
--no-worktrees |
Only show the current project’s services, hiding nested worktree services. |
--global |
List only global services. |
--worktree <branch> |
List services for a sibling worktree by branch name (use main for the primary checkout). |
--status <status> |
Filter by runtime status. Accepts a single value or a comma-separated list: running, stopped, error. |
# Only running services across every projectdenvig services list --all --status running
# Services in the `feature/x` worktree of another projectdenvig services list --project marcqualie/denvig --worktree feature/xStart a service:
denvig services start <name>The name can be a bare service name (api) or a cross-project path
(marcqualie/denvig/hello).
| Option | Description |
|---|---|
--worktree <branch> |
Start the service in a sibling worktree by branch name (use main for the primary checkout). |
--port <port> |
Port to start on, or random to allocate a free dev port. Defaults to the configured port, falling back to a random one when it’s busy. |
--domains <list> |
Comma-separated domains to route to this start, replacing the configured ones and claiming them from any current owner (handed back on stop). |
--no-domains |
Start without claiming any domain — run on the port only and leave any existing route owner in place. Takes precedence over --domains. |
# Claim api.local for the feature worktree's copy of the servicedenvig services start api --worktree feature/x --domains api.local
# Run a throwaway instance on a random port without touching the gatewaydenvig services start api --port random --no-domainsRun a service in the foreground, streaming its output to your terminal until you
press Ctrl+C. The service is routed through the gateway exactly as it would be
with start, and any domains it claimed are handed back when it exits:
denvig services run <name>It accepts the same options as start:
| Option | Description |
|---|---|
--worktree <branch> |
Run the service in a sibling worktree by branch name (use main for the primary checkout). |
--port <port> |
Port to run on, or random to allocate a free dev port. Defaults to the configured port, falling back to a random one when it’s busy. |
--domains <list> |
Comma-separated domains to route to this run, replacing the configured ones and claiming them from any current owner (handed back on exit). |
--no-domains |
Run without claiming any domain — run on the port only and leave any existing route owner in place. Takes precedence over --domains. |
# Debug the api service with live output, on its usual domaindenvig services run apiPress Ctrl+C a second time to force-kill a service that doesn’t stop. --json
is not supported because the output is streamed directly.
Stop a running service. Any domains it claimed via --domains are handed back to
their previous owner:
denvig services stop <name>| Option | Description |
|---|---|
--worktree <branch> |
Stop the service in a sibling worktree by branch name (use main for the primary checkout). |
restart
Section titled “restart”Restart a service:
denvig services restart <name>| Option | Description |
|---|---|
--worktree <branch> |
Restart the service in a sibling worktree by branch name (use main for the primary checkout). |
--port <port> |
Port to start on, or random to allocate a free dev port. Defaults to the configured port, falling back to a random one when it’s busy. |
--domains <list> |
Comma-separated domains to route to this start, replacing the configured ones and claiming them from any current owner (handed back on stop). |
status
Section titled “status”Show the status of a specific service, including recent log lines:
denvig services status <name>| Option | Description |
|---|---|
--worktree <branch> |
Show the service in a sibling worktree by branch name (use main for the primary checkout). |
Show logs for a service:
denvig services logs <name>| Option | Description |
|---|---|
-n <lines> |
Number of lines to show. |
--follow |
Keep streaming new log output. |
--worktree <branch> |
Show logs for the service in a sibling worktree by branch name (use main for the primary checkout). |
# Tail the last 100 lines and keep followingdenvig services logs api -n 100 --followA service’s log is rotated only when the service is actually started or
restarted, so other services commands never leave you with an empty log.
teardown
Section titled “teardown”Stop all of the project’s services and remove them from launchctl:
denvig services teardownYou can also tear down all services on your machine at once as a hard reset:
denvig services teardown --global| Option | Description |
|---|---|
--global |
Tear down all denvig services across all projects. |
--remove-logs |
Also remove the services’ log files. |
--worktree <branch> |
Tear down services for a sibling worktree by branch name (use main for the primary checkout). |
Docker services
Section titled “Docker services”A service with runtime: docker runs inside a docker container instead of
directly on your machine. Denvig still supervises it with launchctl, so every
subcommand above works the same way. The project is mounted at
/denvig/project and the working directory is set to the service’s location
within it. See service configuration for
the available options.
Docker services that share container.volumes across worktrees always run from
the primary checkout. Running a service command from a worktree manages that
single shared instance rather than starting a second copy.