Skip to main content

Env

Manage and apply environments across all repositories.

raid env [name|list]

Subcommands

CommandDescription
raid envShow the currently active environment
raid env <name>Apply a named environment to all repositories
raid env listList all available environments

Examples

Check the active environment:

raid env

Switch to staging:

raid env staging

List all available environments:

raid env list

What applying an environment does

When you run raid env <name>, raid:

  1. Runs the profile-level environment tasks
  2. For each repository, writes its configured .env variables and runs its environment tasks

This happens across all repositories at once. Switching contexts — local to staging, staging to production — is a single command.

JSON output

raid env (no args) and raid env list both accept --json for scriptable output.

raid env --json returns a single entry with the same {name, active} shape used by raid env list --json. When no environment is loaded, name is empty and active is false.

raid env --json
# { "name": "staging", "active": true }

raid env list --json
# [
# { "name": "local", "active": false },
# { "name": "staging", "active": true },
# { "name": "prod", "active": false }
# ]

raid env <name> (the mutating form) does not accept --json — apply mode is interactive by design.

Defining environments

Environments are defined in your profile and in individual repository raid.yaml files. See Environments for the full format.

profile.yaml
environments:
- name: "local"
variables:
- name: "LOG_LEVEL"
value: "debug"
tasks:
- type: Shell
cmd: "docker-compose up -d db"
- name: "staging"
variables:
- name: "LOG_LEVEL"
value: "info"
- name: "production"
tasks:
- type: Confirm
message: "Switch to production?"