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.
| Variable | Description |
|---|---|
CONDUCTOR_WORKSPACE_NAME | Workspace display name. Local workspaces fall back to their directory name; cloud workspaces set it only when a display name is available. |
CONDUCTOR_WORKSPACE_PATH | Workspace path. |
CONDUCTOR_ROOT_PATH | Repository root path. In a cloud workspace, this is the same as CONDUCTOR_WORKSPACE_PATH. |
CONDUCTOR_DEFAULT_BRANCH | Target branch for local workspaces, usually main. Not set in cloud workspaces. |
CONDUCTOR_BASE_DIR | Parent directory of the cloud workspace. Not set in local workspaces. |
CONDUCTOR_PORT | First port in a range of 10 ports assigned to a local workspace. Not set in cloud workspaces. |
CONDUCTOR_IS_LOCAL | 1 in local workspaces and 0 in cloud workspaces. |
CONDUCTOR_API_URL | Conductor API base URL. Set in every cloud workspace and not set in local workspaces. |
CONDUCTOR_API_TOKEN | Workspace-scoped API token in new machine-launched cloud workspaces by default. Each user can configure automatic API access separately for each organization in Settings → User → General. Changes affect only new workspaces; existing workspaces and tokens are unchanged. Not set automatically in other cloud or local workspaces. |
CONDUCTOR_API_KEY | Your own Conductor API key when you configure one; it takes precedence over the workspace token. When you don't supply your own, workspaces that receive an automatic token also set it here, and older cloud workspaces set their automatic workspace-scoped credential only here. |
CONDUCTOR_SESSION_ID | Current session ID in agent processes on current workspaces. It is not available to setup scripts or ordinary terminal processes, and older cloud sandboxes may not have it. Send it as the optional X-Conductor-Session-Id API header. |
Configure custom variables
Use settings when every agent, terminal, setup script, or run script in a repository needs the same custom environment variables:
"$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" .envUse 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.