Env files
Beside the machine's secrets file, the conductor looks for one env file per level, from general to specific. Every file that exists is loaded; a later file overrides an earlier one per variable. A missing file is no error.
| Level | File | Key |
|---|---|---|
| Machine | ~/.bakers/.bakers.env | the secrets file |
| Project | ~/.bakers/envs/project/.bakers-<project>.env | project.name in project.config.js, e.g. .bakers-bakers.env |
| Runtime | ~/.bakers/envs/runtime/.bakers-<runtime>.env | the run's runtime alias, e.g. .bakers-system.env |
| Agent addon | ~/.bakers/envs/agent/.bakers-<harness>.env | the harness id, e.g. .bakers-claude.env |
| Agent alias | ~/.bakers/envs/agent/.bakers-<alias>.env | the agent alias, e.g. .bakers-opus.env |
There are no combined files. An alias equal to its harness id is the same file and loads once. A key that is empty or contains / or \ has no file. BAKERS_HOME moves all of them.
- Rules: format, bad line, permissions (
chmod 600), redaction and restart on change are those of the secrets file, for every file. The conductor loads every file under~/.bakers/envs/at start, so a bad file of any project stops the start. It creates the three folders and restarts when a.bakers-*.envfile in them is written or created; a file written while the conductor starts counts only on its next write. - Hand-out: a variable the agent addon declares reaches the run from the most specific file that sets it. A variable in a project, runtime or agent file reaches the run even when undeclared; one only in the machine file does not. A non-empty value exported in the conductor's shell wins over every file, and a host run keeps the shell's own value. A variable the conductor sets for the run itself, such as
HOMEor aBAKERS_*value, is never overridden. - Addons: an agent or runtime addon reads only the values the conductor hands it, never an env file or the conductor's environment.