Skip to content

The job environment

nuf builds the environment for the work it starts, and only for that. A job’s steps, and a command run with nuf env run, get names from layers of YAML files. Your own shell is never changed.

Three layers, and the last one wins each name whole:

  1. the env: section of the repository’s nuf.yaml, which travels with the code and holds no secret;
  2. .nuf/config/env.yaml, with its section for this platform;
  3. .nuf/config/local/env.yaml, this machine’s own.
# .nuf/config/env.yaml: shared, in Git, no secrets
APP_MODE: test
platforms:
<platform>: # a section named as nuf names the platform; nuf env shows this machine's
BROWSER_FLAGS: "--headless"
# .nuf/config/local/env.yaml: this machine only, git-ignored, readable by you only (chmod 600)
API_TOKEN: "..."

The reader of the env: section in nuf.yaml is not built yet, so today the two files in .nuf/config/ are the layers.

  • Literal. A value is taken as written. $HOME, backticks and $(...) stay as they are; nothing is expanded or run. YAML’s own quoting still applies, so single-quote a value to keep every character.
  • Only what nuf starts. The values reach only a job’s steps and nuf env run. They never reach your shell, or nuf’s own calls to git and the repository host.
  • The local file stays local. Nothing from config/local/env.yaml travels to a rented machine, enters the ledger or is printed.
  • Part of a job’s identity. The shared layers are part of a job’s key, so two environments never share a check result.
  • No dotenv. nuf reads no .env file and no .envrc. A repository’s own .env.local belongs to its framework, and .envrc is a script.

nuf refuses to run jobs with a config/local/env.yaml that others may read or write. It names the fix, chmod 600.

nuf env lists each name with the layer it comes from. It shows a value only from a shared file. A local value shows as set in config/local/env.yaml, never its value.

nuf env run -- <command> runs one command in the current folder with the job environment on top of your shell’s, so a builder’s quick checks see what its jobs see:

Terminal window
nuf env run -- npm test

Nothing after -- is read as a flag. The command’s own exit code is nuf’s answer. Only nuf’s own failures before the command starts answer 2, 64 or 70.