Environment variables¶
This page lists environment variables that affect carrier.
User-facing variables¶
| Variable | Used by | Meaning |
|---|---|---|
CARRIER_COLOR |
all human-readable output | Set always, 1, or true to force colors; never, 0, or false to disable. |
NO_COLOR |
all human-readable output | Any non-empty value disables colors. |
TERM |
all human-readable output | TERM=dumb disables colors. |
XDG_CONFIG_HOME |
config loading | Changes config path to $XDG_CONFIG_HOME/carrier/config.toml. |
HOME |
config and default paths | Used for ~ expansion and default XDG-style locations. |
SHELL |
run, rerun, shell |
Used for metadata, shell fallback, and default shell mode program. |
EDITOR |
rerun --edit |
Editor used to modify argv JSON before rerun. |
VISUAL |
rerun --edit |
Fallback editor if EDITOR is not set. |
These variables override the persistent [ui] color config setting for a single invocation. Precedence, highest first: NO_COLOR / TERM=dumb (always disable) → CARRIER_COLOR → [ui] color config → automatic TTY detection.
Color examples
Captured command environment¶
By default, carrier run stores the command environment as JSON metadata:
Inspect captured environment:
Values are redacted when displayed unless you pass --no-redact.
Warning
Environment variables often contain credentials. Keep redaction enabled when environment capture is enabled.
Disable capture:
Shell-mode variables¶
carrier shell and carrier attach set these variables in the child shell environment:
| Variable | Purpose |
|---|---|
CARRIER_SESSION_ID |
Integer ID of the current shell session. Used by carrier session label to identify the current session. |
CARRIER_SHELL_STATE |
Path to temporary shell state JSON. |
CARRIER_NOTIFY |
Passes notification request into shell hook runs. |
CARRIER_NOTIFY_ALWAYS |
Passes always-notify request into shell hook runs. |
CARRIER_NO_REDACT |
Passes redaction override into shell hook runs. |
CARRIER_SESSION_ID is the only variable intended for direct use. When running inside a tracked shell, omit the session ID argument to carrier session label and it will read from this variable:
The remaining variables are implementation details. Do not set them manually unless you are debugging shell mode internals.