Introducing Conductor Cloud →Skip to docs content
Conductor

Conductor environment variables

Variables available to terminals and scripts in a workspace

Conductor makes these environment variables available in workspace terminals and scripts.

VariableDescription
CONDUCTOR_WORKSPACE_NAMEWorkspace name
CONDUCTOR_WORKSPACE_PATHWorkspace path
CONDUCTOR_ROOT_PATHPath to the repository root directory
CONDUCTOR_DEFAULT_BRANCHName of the default branch, usually main
CONDUCTOR_PORTFirst port in a range of 10 ports assigned to the workspace

Configure custom variables

Use settings when every agent, terminal, setup script, or run script in a repository needs the same custom environment variables:

.conductor/settings.toml
"$schema" = "https://conductor.build/schemas/settings.repo.schema.json"

[environment_variables]
API_BASE_URL = "http://localhost:3000"

[environment_variables.local]
CONDUCTOR_TARGET = "local"

[environment_variables.cloud]
CONDUCTOR_TARGET = "cloud"

Use environment_variables for values shared by local and cloud agents. Use environment_variables.local and environment_variables.cloud when a value should only apply to one execution environment. Do not commit secrets to .conductor/settings.toml; use .conductor/settings.local.toml for machine-local secret values. For the full key reference, see Settings reference.

Common uses

Use CONDUCTOR_ROOT_PATH when a setup script needs a file from the repository root:

ln -s "$CONDUCTOR_ROOT_PATH/.env" .env

Use CONDUCTOR_PORT when multiple workspaces need to run the same app without port conflicts:

npm run dev -- --port "$CONDUCTOR_PORT"

For script behavior, see Scripts.

On this page