.finalrun/env/<name>.yaml, then activate it with --env <name> or by setting env: <name> in .finalrun/config.yaml. Separating environments lets you run the same test specs against development, staging, and production configurations without touching the tests themselves.
Environment file structure
Each environment file lives at.finalrun/env/<name>.yaml and can contain three top-level blocks:
Per-environment app identity override. Values here take priority over the workspace default in
config.yaml. Useful when your staging or debug build uses a different package name or bundle ID.Placeholder bindings for sensitive values. Each value uses
${SHELL_ENV_VAR} syntax. The CLI resolves each placeholder from the shell environment or from workspace-root dotenv files at runtime. Do not put real secrets in this file.Plain, non-sensitive values such as locale strings, feature flags, or base URLs. Safe to commit.
Full example
.finalrun/env/dev.yaml
${secrets.email} and ${variables.locale}.
Dotenv files for secret values
Real secret values — API keys, passwords, tokens — belong in dotenv files at the workspace root, not in the YAML binding file.| File | Purpose |
|---|---|
.env | Shared defaults loaded for all runs |
.env.<name> | Environment-specific values loaded when --env <name> is active (e.g. .env.dev for --env dev) |
.finalrun/, regardless of where you run the CLI from.
Load order
For an active environment namedN, the CLI loads values in this order:
Load .env.N
Environment-specific dotenv file is read first. Keys set here take precedence over the shared file.
secrets placeholder resolution and AI provider API key resolution.
Using environments with the CLI
Pass--env to activate a named environment for any command:
env: dev in .finalrun/config.yaml, --env becomes optional and the CLI uses dev by default.
