Skip to content

Configuration

gokazi reads YAML configuration from one or more -c sources (use - for stdin). Sources merge top-down: later sources override earlier ones.

Top level

FieldTypeRequiredDescription
versionstringyesMust equal "1.0". Loading fails otherwise.
tasksmap<string, Task>yesTask ID → task definition. The ID is the key passed to gokazi stop <id>.

Task

FieldTypeRequiredEnv expansionDescription
namestringyesnoProcess name to match. Typically the binary basename (e.g. gokazi, not /usr/bin/gokazi).
descriptionstringnonoHuman-readable description. Surfaced in gokazi list JSON.
pathstringnoyesDirectory containing the executable. Compared against path.Dir(exe).
cwdstringnoyesWorking directory of the running process. Compared after path.Clean + os.ExpandEnv.
args[]stringnoyesSubset match: every entry must appear somewhere in cmdline[1:]. Order and extras don't matter.

Multi-source config

gokazi -c shared.yaml -c overrides.yaml list reads shared.yaml first, then overrides.yaml on top. Maps are merged by key; scalars and arrays are replaced.

shell
# Read from stdin in addition to a file
cat <<'EOF' | gokazi -c gokazi.yaml -c - list
version: '1.0'
tasks:
  experimental:
    name: my-server
    args: [--port=9090]
EOF

See Multi-source config for layered-team-config patterns.

Env-var expansion

Fields marked with env expansion run through Go's os.ExpandEnv at match time, so $PWD, $HOME, etc. resolve from the current gokazi invocation's environment — not the environment of the matched process.

yaml
tasks:
  api:
    name: api-server
    path: $PWD/bin
    cwd: $PWD
    args: [--config=$ENV_NAME.json]

If the variable is unset, it expands to the empty string.

Schema

The JSON schema is generated from the Go config types and lives at gokazi.schema.json. Wire it into your editor:

yaml
# yaml-language-server: $schema=https://raw.githubusercontent.com/foomo/gokazi/main/gokazi.schema.json
version: '1.0'
tasks:
  ...