Skip to main content

Environment variables

This page lists the variables Kule itself reads, and what the environment of a command inside a task looks like.

Variables Kule reads​

VariableRead byMeaning
KULE_HOMEkule, the daemon, the appKule's home. Default ~/.kule. The same as --home on every command. Keep it short: the daemon's socket path inside it must stay under 100 bytes. A home other than ~/.kule keeps the secrets' key in a file (secrets.key) instead of the system keychain.
HOMEeverythingYour home directory: where ~/.kule is, and what the sandbox hides your own folders under.
PATHthe app, the sandboxWhere commands and agents (npx, node, gemini, …) are found. Opened from the Finder or a launcher, the app reads PATH from your login shell, so it finds the same tools as a terminal.
SHELLkule shell, the app's terminalsThe shell to open in a task's copy.
NO_COLORkuleSet (non-empty) to turn colours off. Colour is also off when the output is not a terminal, or TERM=dumb.
KULE_TERMINALthe appThe terminal app Open terminal uses: an app name on macOS (for example iTerm), a command on Linux. Without it, macOS uses the terminal the app was started from, else Terminal; Linux tries the usual terminals on PATH.
KULE_NO_EXTENSIONSthe appSet to start the app with every extension off, like --no-extensions.
CARGO_HOMEthe sandboxWhere your cargo caches are, to start a task's own from.
XDG_CONFIG_HOMEthe sandboxWhen it points at your real ~/.config, a command gets the home layer's .config instead.
XDG_RUNTIME_DIRthe sandbox (Linux)Your runtime directory, where session sockets live; kept out of a command's reach.
ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, …the built-in agentsRead only to be filled into requests to the agent's own API host; the agent sees a placeholder. See keys in Agents.

What a command in a task sees​

Commands that kule exec, kule run's agent, and the app's agents start in a task get a trimmed environment. Only what tools need to find themselves passes through; tokens, keys and agent sockets in your environment stay out.

Passed through as they are​

PATH, USER, LOGNAME, SHELL, LANG, LANGUAGE, every LC_*, TZ, TERM, COLORTERM, NO_COLOR, FORCE_COLOR, EDITOR, PAGER, __CF_USER_TEXT_ENCODING, XDG_DATA_HOME, XDG_STATE_HOME, RUSTUP_HOME, RUSTUP_TOOLCHAIN, GOPATH, GOROOT, JAVA_HOME, NVM_DIR, NVM_BIN, VOLTA_HOME, PYENV_ROOT, VIRTUAL_ENV, CONDA_PREFIX, DOTNET_ROOT, ANDROID_HOME, SDKROOT, DEVELOPER_DIR, HOMEBREW_PREFIX, HOMEBREW_CELLAR, HOMEBREW_REPOSITORY.

To pass one more for a single command: kule exec --pass-env NAME. An agent profile names its own under pass_env.

Set by Kule​

VariableValueWhy
KULE_TASKthe task's idSet by kule exec, kule shell and the app's terminals, so a script can tell which task it runs in.
HOME<task>/homeThe task's home layer: writes there are caught for review.
XDG_CONFIG_HOME<task>/home/.configOnly when yours pointed at your real ~/.config.
TMPDIR<task>/tmpThe task's own temporary directory.
HTTP_PROXY, HTTPS_PROXY, ALL_PROXY (and lower-case)http://127.0.0.1:<port>The task's proxy, which judges and logs every connection. NO_PROXY is removed.
NODE_USE_ENV_PROXY1Makes Node's built-in fetch use the proxy.
SSL_CERT_FILE, CURL_CA_BUNDLE, REQUESTS_CA_BUNDLE, PIP_CERT, GIT_SSL_CAINFO, CARGO_HTTP_CAINFO, AWS_CA_BUNDLE<task>/tmp/kule-ca-bundle.pemThe system's roots plus the task's own certificate authority, which the proxy uses to fill in secrets for their hosts.
NODE_EXTRA_CA_CERTS<task>/tmp/kule-ca.pemThe same authority, for Node.
GODEBUGadds x509sslcertoverrideplatform=1macOS: makes Go check certificates against SSL_CERT_FILE. Your own GODEBUG settings are kept.
CARGO_HOME<task>/tmp/caches/cargoThe task's own cargo cache (with your cargo settings, never credentials.toml).
npm_config_cache<task>/tmp/caches/npmThe task's own npm cache.
PNPM_HOME, pnpm_config_store_dirunder <task>/tmp/caches/pnpmpnpm.
YARN_CACHE_FOLDER, PIP_CACHE_DIR, UV_CACHE_DIR, GOCACHE, GOMODCACHE, NUGET_PACKAGES, XDG_CACHE_HOMEunder <task>/tmp/caches/Each tool's cache, the task's own.
NODE_OPTIONS, PYTHONPATH, RUBYOPTload a small file from <task>/tmp/.kule-loopback/Points Node, Python and Ruby servers that ask for every address at this computer only. (On Linux Kule also holds every program's servers to loopback by itself.) Your own values are kept.
a kept secret's name, e.g. STRIPE_KEYkule_secret_…A placeholder; the proxy puts the value in only for that secret's hosts.

With kule exec --no-network, no proxy variables are set and TCP is shut. With --open-network, commands connect directly, without the proxy or the policy. With --no-sandbox, none of the above holds.

On macOS, the cargo and npm caches start as copy-on-write clones of yours, so they take no space until the task adds to them. On Linux they start empty.

Look for yourself​

kule exec TASK -- env | sort

See also​