Built-in Environment Variables
Which environment variables city and agent commands inject for the current Agent context
Built-in Environment Variables
When the CLI runs agent-related commands, it derives the current agent context and injects a few environment variables.
The most common ones are:
DC_CITY_HOSTDC_CITY_PORTDC_AGENT_IDDC_AGENT_PATHDC_SESSION_ID
DC_CITY_HOST / DC_CITY_PORT
The current Town runtime endpoint inherited by nested town invocations.
They are mainly used when an agent shell or tool launches another town command and that child process needs to route back to the current runtime.
DC_AGENT_ID
The current agent runtime id.
Current Town runtime uses the same resolved id value that is passed into new Agent({ id }).
DC_AGENT_PATH
The absolute path of the current agent project.
This is useful in scripts, logs, and debugging workflows.
DC_SESSION_ID
The current execution session id.
This is mainly injected for runtime tool execution so child processes can stay associated with the current session.
These variables are injected for the current command execution context. They are not permanently written back into your current shell session.