Skip to content
DocsChangelogv0.7.8

CLI Configuration

Global configuration can be set via YAML files or environment variables.

Global Configuration Sources (in order of precedence, highest first):

  1. Environment variables (DENVIG_PROJECT_PATHS, DENVIG_QUICK_ACTIONS)
  2. ~/.denvig/config.yml
  3. Default values

Project Configuration is loaded from ./.denvig.yml in the project root.

  • default: ['~/src/*/*', '~/.dotfiles']
  • env: DENVIG_PROJECT_PATHS (comma-separated list, e.g., ~/src/*/*,~/.dotfiles)

An array of paths or glob-like patterns where your projects live. Each * matches a single directory level (not recursive). Prefix a pattern with ! to exclude any path it matches, even when a broader pattern would include it.

Development environments work best when there is a consistent location for all projects. Denvig works best on the concept of [group]/[project] so you can have a consistent structure for all your projects. Since most people use GitHub, this maps to [owner]/[repo]. You could subpath them based on hosting provider such as ~/src/github/[owner]/[repo] or ~/src/gitlab/[owner]/[repo] if you want to keep them separate.

Pattern Examples:

  • ~/src/*/* - Matches all directories two levels deep under ~/src
  • ~/.dotfiles - Matches a single specific directory
  • !~/src/example-project/* - Excludes every project owned by example-project
  • !~/src/acme/legacy-app - Excludes a single project

Excluding a directory also excludes everything inside it, so !~/src/example-project has the same effect as !~/src/example-project/*. Quote exclusions in YAML, since a value starting with ! is otherwise read as a tag.

Project Slugs:

Projects are identified by slugs that indicate their source:

  • [provider]:owner/repo - For projects with a remote matching one of the gitProviders (eg. github:owner/repo)
  • local:/absolute/path - For projects without a recognised remote

Example Configuration:

projectPaths:
- ~/src/*/*
- ~/work/*/*
- ~/.dotfiles
- "!~/src/example-project/*"
  • default: a single github provider

Git hosts used to derive project slugs. The key is the slug prefix, so a project hosted on gitea-mqn gets the slug gitea-mqn:owner/repo. The built-in github provider is always included, and you can override it by defining a github key.

Key Description
type One of github, gitlab, gitea, or git. Used for display, eg. icons. Use git for hosts without built-in icon support.
url Repository URL template using {{owner}} and {{repo}} placeholders. Only {{repo}} is required.
name Display name for the provider.

A project’s slug comes from its origin remote, falling back to a remote named after a provider key (eg. a github remote alongside an origin that points at a mirror). SSH and HTTPS remotes both match, including SSH on a custom port. Keys cannot be git, global, id, or local.

gitProviders:
gitea-mqn:
type: gitea
url: https://gitea.example.com/{{owner}}/{{repo}}
name: Gitea
git-vps:
type: git
url: https://vps.example.com/{{repo}}
name: Git VPS

This gives slugs like github:owner/repo, gitea-mqn:owner/repo, and git-vps:repo.

  • default: build, dev, check-types, install, lint, outdated, test
  • env: DENVIG_QUICK_ACTIONS (comma-separated list, e.g., build,dev,lint; empty string disables)

A list of actions that will be available by default for all projects. See local configuration for more details.

Setting an empty string via the environment variable disables quick actions entirely:

Terminal window
export DENVIG_QUICK_ACTIONS=""

Global services are defined exactly like project services but live in ~/.denvig/config.yml. They are not tied to any single project and are useful for machine-wide tooling such as a mail catcher or a local LLM server.

services:
mailpit:
command: /opt/homebrew/opt/mailpit/bin/mailpit --smtp 0.0.0.0:1025
http:
port: 8025
domain: mailpit.denvig.me
secure: true

Configuration for the local gateway reverse proxy.

Key Description
handler The gateway handler. Currently always nginx.
configsPath The nginx servers directory. Denvig writes the main nginx.conf to its parent directory, which includes ~/.denvig/nginx.conf where every routed service’s server block lives.
gateway:
handler: nginx
configsPath: /opt/homebrew/etc/nginx/servers

The file location for project configuration is ./.denvig.yml in the root of your project.

optional

Unique identifier for the project. Slug will be used if not provided, then falling back to path.

optional

Actions that can be run against the project. Each action is defined with a command to execute.

Example:

actions:
build:
command: pnpm build
clean:
command: rm -rf dist
test-with-coverage:
command: pnpm test --coverage

optional

Actions that are available on the CLI root for quick access. This overrides the global quickActions setting for this specific project.

Example:

quickActions:
- build
- dev
- test

optional

Service definitions for the project. Each service can have its own configuration including command, HTTP settings, and environment variables.

Service names must start with a letter, contain only lowercase alphanumeric characters and hyphens, not end with a hyphen, and be 64 characters or less.

Service Options:

  • command (required for host services): Shell command to execute. Docker services can omit it to use the image’s default command
  • runtime (optional): How the service runs: host (default) runs it directly on your machine, docker runs it in a container
  • image (optional): Container image to run when runtime is docker. Defaults to alpine:3.23
  • container (optional): Container options used when runtime is docker
    • container.mountProject (optional): Mount the project directory at /denvig/project. Defaults to true
    • container.volumes (optional): Bind mounts passed to docker run -v (host:container[:options]). Relative host paths resolve against the service directory
    • container.ports (optional): Published ports passed to docker run -p (host:container), for ports exposed directly rather than through the gateway
  • cwd (optional): Working directory for the service (relative to project root)
  • http (optional): HTTP configuration for the service
    • http.port (optional): Port number the service listens on
    • http.containerPort (optional): Port the container listens on when runtime is docker. Defaults to http.port
    • http.domain (optional): Domain to use for the service URL
    • http.cnames (optional): Additional domains routed to the service through the gateway
    • http.secure (optional): Use HTTPS instead of HTTP
  • envFiles (optional): Array of paths to .env files (relative to service cwd)
  • env (optional): Environment variables as key-value pairs
  • keepAlive (optional): Restart service if it exits
  • startOnBoot (optional): Start service automatically when system boots

Example:

services:
api:
command: pnpm dev
cwd: apps/api
http:
port: 3000
domain: api.local
secure: true
envFiles:
- .env
- .env.local
env:
NODE_ENV: development
keepAlive: true
startOnBoot: true
web:
command: pnpm dev
cwd: apps/web
http:
port: 3001
domain: web.local

Docker example:

A docker service runs in a container with the project mounted at /denvig/project and the working directory set to the service’s cwd within it. Denvig still supervises it with launchctl, so all services subcommands work the same way.

services:
postgres:
runtime: docker
image: postgres:17
container:
mountProject: false
volumes:
- ./tmp/postgres:/var/lib/postgresql/data
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
docs:
runtime: docker
image: node:24-alpine
command: node server.js --port 8080
cwd: apps/docs
http:
port: 4000
containerPort: 8080
domain: docs.local

Denvig provides tab completions for ZSH. Install them to the default location with:

Terminal window
denvig shell completions zsh --install

See the shell command for fpath setup and custom install locations.