Skip to content
DocsChangelogv0.7.8

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.

Terminal window
denvig services <subcommand>
Option Description
--project The project slug to run against. Defaults to the current directory.
--json Output in JSON format.

List the current project’s services, with each worktree’s services nested beneath it:

Terminal window
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.
Terminal window
# Only running services across every project
denvig services list --all --status running
# Services in the `feature/x` worktree of another project
denvig services list --project marcqualie/denvig --worktree feature/x

Start a service:

Terminal window
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.
Terminal window
# Claim api.local for the feature worktree's copy of the service
denvig services start api --worktree feature/x --domains api.local
# Run a throwaway instance on a random port without touching the gateway
denvig services start api --port random --no-domains

Run 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:

Terminal window
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.
Terminal window
# Debug the api service with live output, on its usual domain
denvig services run api

Press 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:

Terminal window
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 a service:

Terminal window
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).

Show the status of a specific service, including recent log lines:

Terminal window
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:

Terminal window
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).
Terminal window
# Tail the last 100 lines and keep following
denvig services logs api -n 100 --follow

A 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.

Stop all of the project’s services and remove them from launchctl:

Terminal window
denvig services teardown

You can also tear down all services on your machine at once as a hard reset:

Terminal window
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).

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.