Introducing Conductor Cloud →Skip to docs content
Conductor

Conductor environment variables

Variables available to workspace terminals, agents, and scripts

Conductor makes these environment variables available in workspace terminals, agents, and scripts. Cloud workspaces do not receive CONDUCTOR_PORT or CONDUCTOR_DEFAULT_BRANCH; see cloud workspace environment variables for cloud-specific details.

VariableDescription
CONDUCTOR_WORKSPACE_NAMEWorkspace display name. Local workspaces fall back to their directory name; cloud workspaces set it only when a display name is available.
CONDUCTOR_WORKSPACE_PATHWorkspace path.
CONDUCTOR_ROOT_PATHRepository root path. In a cloud workspace, this is the same as CONDUCTOR_WORKSPACE_PATH.
CONDUCTOR_DEFAULT_BRANCHTarget branch for local workspaces, usually main. Not set in cloud workspaces.
CONDUCTOR_BASE_DIRParent directory of the cloud workspace. Not set in local workspaces.
CONDUCTOR_PORTFirst port in a range of 10 ports assigned to a local workspace. Not set in cloud workspaces.
CONDUCTOR_IS_LOCAL1 in local workspaces and 0 in cloud workspaces.

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