Apply a local file
Start with an environment you can write to. The file does not create environments; use the app orreplicas environment create first.
Save infra/development.yaml:
--yes skips the prompt. Preview again afterward to check for no setting changes.
JSON uses the same wrapper:
Link Git and use an infra pointer
Git reads a rootreplicas.json, replicas.yaml, or replicas.yml, in that order. Only the first existing filename is used. Keep one root entrypoint.
Put the environment block there, or point to a separate file:
environment wrapper. Its path is relative to the entrypoint. Do not combine infra and environment in one entrypoint or chain pointers. Existing top-level repository hooks can remain beside infra.
Commit both files to the repository’s default branch. The repository must be connected to the organization and attached to the environment.
replicas environment config disconnect "Development" to release its file source, then preview and link the repository. Disconnecting keeps the current settings.
After merging a change to the default branch, check the source in the UI and review its changes, or run:
infra target. Invalid configuration or missing secrets preserve the last applied settings and show an error. Turn automatic apply off to return to manual review:
Ownership and removal
startHook does not replace the parent’s script. inheritRepositories: true inherits the parent’s repository list and cannot be combined with repositories.
This is environment inheritance, not file inheritance. An infra pointer selects one file; it does not merge files.
Two hook locations
Both can run. Applying an environment block does not suppress top-level repository hooks.
environment.setupSourceMode selects execution sources:
“App” includes environment hooks managed through configuration. Do not select
repo_only to run environment.startHook: it disables environment hooks. The selected environment’s mode controls its whole chain. See setup sources.
Secrets and MCP references
Store sensitive values in Environment Variables, then reference names:variables and requiredSecrets. Secrets can be inherited; removing a requirement does not delete the value.
Do not commit secret values in variables, file contents, scripts, or literal MCP headers/environment values. requiredPlugins checks existing connections; it does not connect accounts or perform OAuth sign-in.
Supported fields
All fields below are optional insideenvironment. Unknown fields are rejected.
For
stdio MCPs, config contains command, optional args, and env. For HTTP/SSE, it contains url, optional auth, and headers. Environment/header values can be strings or { env: "NAME", prefix: "optional prefix" } references.
Environment creation, names, parent selection, and automation definitions are outside this block. Use the app or API for lifecycle actions and Automations for triggers.
Verify a new workspace
Wait for pending builds to finish, then start a new workspace. Verify variables, files, tools, and hook output there. Running workspaces do not receive every change in place; the environment’s status tells you what new workspaces get. If preview is blocked, fix the listed secrets, plugin connections, repository access, or invalid settings and retry. A saved Git change is not proof it was applied: inspectreplicas environment config get and the UI’s configuration source.
Migrate an existing environment
Export its own settings first, preserving inheritance instead of copying parent values into the child. Get its UUID fromreplicas environment list --json. Set ENVIRONMENT_ID to that ID and REPLICAS_API_KEY to an organization or personal API key with write access to the environment. Save the export locally:
environment and warnings. Read every warning before adoption. With jq installed: