Get started

Multiple environments and folder inheritance

Use Infisical environments and project folders to share and override values.

6 min readUpdated 3 days agoEdit on GitHub

One workspace binds to one Infisical project. environments.names declares environment names, while folder paths separate shared and project-specific variables.

Environment names

New workspaces use dev, preview, and prod. To add qa:

one env set API_URL=https://qa.example.com -p web --env qa --yes
one env list -p web --env qa
one exec -p web --env qa -- pnpm test

set registers the environment name. list rejects undeclared names. Omit --env to use the manifest default.

Folder inheritance

The workspace env.rootPath defaults to /. Projects default to folders matching relativeDir. For services/api, the merge order is:

/ → /services → /services/api

Closer folders override matching keys. Configure a custom path in the project's env field:

{
  "name": "api",
  "relativeDir": "services/api",
  "env": { "path": "/teams/payments/api", "inherits": true }
}

Set inherits: false to use only that folder. Set disabled: true to skip Infisical injection for the project and inherit the shell environment.

Execution

one run build --env preview
one exec -p api --env prod -- go run ./cmd/server

Generated task adapters and project commands receive fetched variables directly. No local variable files are synchronized. Authentication and fetch failures stop execution. Custom mise tasks continue to use mise's environment.

See one env for binding and error handling, and global credentials for storage independent of a workspace.