Reference·Environment variablesIndex

Environment variables

Every environment variable the nodecode binary and the installers read, and the one it sets for shell commands, by purpose.

.mdllms.txt

A variable applies to the one process that reads it. For lasting settings use Config.

Home

VariableMeaning
NODECODE_HOMEThe home: the folder that holds config, store and cells. Default ~/.nodecode/.

The binary picks the home in this order.

  1. -p NAME or --profile NAME on the command line.
  2. NODECODE_HOME.
  3. The profile named in ~/.nodecode/active-profile.
  4. ~/.nodecode/.

The binary sets NODECODE_HOME for every child process it starts.

Set for shell commands

Nodecode sets this for every command a session's sh runs. You do not set it.

VariableMeaning
NODECODE_SESSION_IDThe id of the session running the command, exactly as Nodecode prints it, such as s-K3F9Q2ZA. A fork's commands get the fork's own id.

A command run outside a session's turn, or by the gateway's own session s-GATEWAY, gets no NODECODE_SESSION_ID, not even one Nodecode itself inherited.

Model

VariableMeaningDefault
NODECODE_PROVIDERProvider id. Outranks general.default_model.openai-completions
NODECODE_MODELModel id. Outranks general.default_model.The build's model
NODECODE_ENDPOINTFull endpoint URL. Outranks every base_url.None
NODECODE_API_KEYAPI key. Outranks providers.<id>.api_key. A leading ! runs a shell command.None
NODECODE_REASONING_EFFORToff, minimal, low, medium, high, xhigh or max.None
NODECODE_TEMPERATURESampling temperature, a number.Not sent
NODECODE_TOP_PNucleus sampling bound, a number.Not sent
NODECODE_MAX_TOKENSOutput token limit, an integer.Not sent
NODECODE_TOOL_CHOICEauto, none or required.Not sent
NODECODE_CONTEXT_TOKENSContext window in tokens, an integer. Outranks every other source.None
NODECODE_MODELS_CATALOGPath of the models.dev catalog cache.~/.cache/nodecode/models.dev/api.json
OLLAMA_HOSTWhere Ollama answers, read the way Ollama's own CLI reads it. Ignored once providers.ollama is set.127.0.0.1:11434

See Models and providers.

Provider keys

Read after the config and auth.json, in this order.

VariableUsed for
<ID>_API_KEYThe provider with that id. The id is uppercased, - becomes _.
OPENAI_API_KEYAny provider on openai-completions or openai-responses.
ANTHROPIC_API_KEYAny provider on anthropic.
GOOGLE_API_KEYAny provider on google.
ANTHROPIC_AUTH_TOKENThe provider id anthropic only.

Gateway

The gateway is the local server shells attach to.

VariableMeaning
NODECODE_GATEWAY_OPERATOR_TOKENThe operator token. Read first.
NODECODE_OPERATOR_TOKENThe operator token. Read second.

Both outrank the operator-token file and gateway.operator_token.

Updates and cell indexes

VariableMeaningDefault
NODECODE_BASE_URLThe release host. update.url outranks it.The host the build was installed from, else https://nodecode.ai/dl
NODECODE_HUB_INDEXAddress of Nodecode's cell index.https://nodecode.ai/dl/cells/index.json
NODECODE_COMMUNITY_INDEXAddress of the community cell index.https://nodecode.ai/cells/community.json

Diagnostics and switches

VariableMeaning
NODECODE_PHASE_LOGA file path. Nodecode appends one timed line per boot phase.
NODECODE_QA0, off, never or false stops every send of the qa cell.
NODECODE_HANDOVERInternal. Set by a profile switch for the next process.
NODECODE_EPHEMERALInternal. 1: a throwaway store. Set by --ephemeral for every process it starts.
NODECODE_PRISTINEInternal. 1: generation 0, no folder loaded. Set by --pristine for every process it starts.
NODECODE_FRONTInternal. The shell's pid, on an organism that shell started.

Named by config

Some config keys hold the name of a variable. Nodecode reads the secret from that variable.

Config keySection
bot_token_envchannels.discord, channels.slack
app_token_envchannels.slack
token_envchannels.telegram, prs
api_key_envtranscription, speech

System variables

VariableUsed for
XDG_CACHE_HOMEThe cache root. Default ~/.cache/.
LOCALAPPDATAWindows: the cache root.
XDG_CONFIG_HOMELinux: where the gateway's systemd unit is written.
XDG_CONFIG_HOME, XDG_CACHE_HOME, XDG_DATA_HOME, PATH, HOMECopied into the background gateway's unit.
TMPDIRWhere an --ephemeral store is created. Unset: /tmp. Windows: TEMP.
XDG_RUNTIME_DIRLinux: how systemctl --user finds the user manager. Unset: /run/user/<uid>.
TERM, COLORTERM, WT_SESSION, TERM_PROGRAMColour depth detection. TERM=dumb gives no colour.
NO_COLORAny value limits the shell to 16 colours.
TMUXWraps clipboard sequences for tmux. TERM=screen... does the same for screen.
WAYLAND_DISPLAY, DISPLAYLinux: a link opens with xdg-open only when one is set.
NOTIFY_SOCKETLinux: readiness messages to systemd.
JOURNAL_STREAMTells Nodecode its logs go to the journal.
USERThe layer folder's name when git has no user.name. Unset: you.
ProgramFiles, LOCALAPPDATAWindows: where to look for Git's sh.exe.

Installer only

install.sh, for Linux and macOS:

VariableMeaningDefault
NODECODE_VERSIONInstall this version.The version the channel names
NODECODE_CHANNELThe release channel to read.stable
NODECODE_BASE_URLFetch from this host.https://nodecode.ai/dl
NODECODE_HOMEThe install folder.~/.local/share/nodecode
NODECODE_STAGEfull, stage or link.full
NODECODE_FORCEAny value but 0: download and lay the version out again, even when it is already laid out and answers. Same as --force.Unset

install.ps1, for Windows:

VariableMeaningDefault
NODECODE_VERSIONInstall this version.The version the channel names
NODECODE_CHANNELThe release channel to read.stable
NODECODE_BASE_URLFetch from this host.https://nodecode.ai/dl
NODECODE_INSTALL_DIRThe install folder.%LOCALAPPDATA%\Programs\nodecode
NODECODE_STAGEfull, stage or link.full
NODECODE_FORCEAny value but 0: download and lay the release out again, even when it is already laid out and answers. Same as -Force.Unset
NODECODE_NO_MODIFY_PATHAny value leaves the user PATH alone.Unset
NODECODE_STAGEDoes
fullDownloads and lays out the version, then points current at it. A version already laid out that answers is kept, with no download.
stageLays out the version. current does not move.
linkPoints current at a version already laid out. No download.

See Install and Updates.

Esc

    Loading the index…

    ↑↓ moveEnter openEsc close