Skip to main content
Manage an environment from YAML or JSON. Preview before applying. Declared settings become read-only in the app; unrelated settings stay editable. Terraform is not required.

Apply a local file

Start with an environment you can write to. The file does not create environments; use the app or replicas environment create first. Save infra/development.yaml:
From that checkout:
Preview changes nothing. Apply shows the preview and asks for confirmation; --yes skips the prompt. Preview again afterward to check for no setting changes. JSON uses the same wrapper:
Git reads a root replicas.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:
The target contains the same 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.
Link previews, connects, and applies the file. The UI shows its resolved path and applied commit. To move a locally managed environment to Git, commit its configuration, run 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:
By default, a push alone does not apply settings. Sync previews the linked source and asks before applying. Non-default branches are not the Git source. Disconnect Git management before applying an unrelated local file. To apply changes automatically, turn on Apply Git changes automatically in the environment’s General settings, or run:
Merges and direct pushes to the default branch queue an update, including changes to an 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:
Disconnecting also stops automatic updates. Local-file sources always require a CLI apply.

Ownership and removal

Always preview removals. Parent and child hooks are additive: the child’s 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:
Missing required secrets block apply. A name cannot be in both 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 inside environment. 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: inspect replicas environment config get and the UI’s configuration source.

Migrate an existing environment

Ask the Replicas agent to do this for you: “Move my existing Development environment into YAML configuration, preserving its current settings and inheritance. Show me the preview before applying.”
Export its own settings first, preserving inheritance instead of copying parent values into the child. Get its UUID from replicas 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:
The response contains environment and warnings. Read every warning before adoption. With jq installed:
Review the exported file before committing. Sensitive variables become required-secret names, and inherited settings stay inherited. Hidden file contents, locked ordinary variables, and newly exported MCPs with hidden literal values can stay unmanaged with warnings. Previously declared file/MCP literals are preserved, so an export of an already managed environment can retain those contents. Initial preview can list unchanged settings as adopted: the file is taking ownership. Check for unintended value changes, apply, then repeat preview and inspect the UI. Keep intermediate exports out of Git if they contain values you do not intend to publish.