> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zerotwo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment variables

ZeroCode uses `config.toml` for durable settings. Use environment variables for
shell-scoped overrides, automation secrets, installer behavior, or diagnostics.

This page lists stable public environment variables that ZeroCode reads directly.
It does not list internal development variables, test variables, or
provider-specific secret names you choose yourself with
[`env_key`](/config-file/config-advanced#custom-model-providers).

## Core locations

| Variable            | Used by                                  | Default        | Description                                                                                                                                                         |
| ------------------- | ---------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ZEROTWO_HOME`      | CLI, desktop app, app-server, installers | `~/.zerotwo`   | Sets the root for ZeroCode state, including config, auth, logs, sessions, skills, and standalone package metadata. If you set it, the directory must already exist. |
| `CODEX_SQLITE_HOME` | CLI and app-server state                 | `ZEROTWO_HOME` | Sets where SQLite-backed state is stored. The `sqlite_home` config option takes precedence. Relative paths resolve from the current working directory.              |

For more about the files stored under `ZEROTWO_HOME`, see
[Config and state locations](/config-file/config-advanced#config-and-state-locations).

## Installer variables

These variables apply to the standalone install scripts served from
`https://zerotwo.ai/zerocode/install.sh` and
`https://zerotwo.ai/zerocode/install.ps1`.

| Variable                | Default                                                                                  | Description                                                                                                                                                     |
| ----------------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `CODEX_NON_INTERACTIVE` | `false`                                                                                  | Set to `1`, `true`, or `yes` to skip installer prompts. Prompts use their default response, so use this for scripted installs and updates, not first-run setup. |
| `CODEX_INSTALL_DIR`     | `~/.local/bin` on macOS/Linux; `%LOCALAPPDATA%\Programs\ZeroTwo\ZeroCode\bin` on Windows | Changes where the visible `ZeroTwo` command is installed. The standalone package cache still lives under `ZEROTWO_HOME/packages/standalone`.                    |

For unattended installs, set `CODEX_NON_INTERACTIVE=1` on the shell that runs
the downloaded installer:

```bash theme={null}
curl -fsSL https://zerotwo.ai/zerocode/install.sh | CODEX_NON_INTERACTIVE=1 sh
```

```powershell theme={null}
$env:CODEX_NON_INTERACTIVE=1; irm https://zerotwo.ai/zerocode/install.ps1 | iex
```

## Authentication and network

| Variable               | Used by                             | Description                                                                                                                                                                         |
| ---------------------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ZEROTWO_API_KEY`      | `ZeroTwo desktop runs`              | Provides an API key for a single non-interactive run. This is only supported in `ZeroTwo desktop runs`; set it inline rather than job-wide when running repository-controlled code. |
| `CODEX_ACCESS_TOKEN`   | CLI, app-server, trusted automation | Provides a ZeroTwo or ZeroCode access token for trusted automation. For persisted login, pipe it to `zerocode login --with-access-token`.                                           |
| `CODEX_CA_CERTIFICATE` | HTTPS, login, and WebSocket clients | Points to a PEM CA bundle for environments with corporate TLS interception or private root CAs. Takes precedence over `SSL_CERT_FILE`.                                              |
| `SSL_CERT_FILE`        | HTTPS, login, and WebSocket clients | Fallback PEM CA bundle path when `CODEX_CA_CERTIFICATE` is unset.                                                                                                                   |

For provider API keys, set
[`env_key`](/config-file/config-advanced#custom-model-providers) in the model provider
configuration. ZeroCode reads the variable named by that config, so the variable
name itself is not a fixed ZeroCode environment variable.

For automation secret handling, see
[Use API key auth](/configuration).
For access token setup, see [Access tokens](/configuration).

## Diagnostics

| Variable   | Used by            | Description                                                                                                                       |
| ---------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| `RUST_LOG` | CLI and app-server | Controls Rust log filtering and verbosity. `ZeroTwo desktop runs` defaults to `error` output unless you set a more verbose value. |

`RUST_LOG` accepts values such as `error`, `warn`, `info`, `debug`, and
`trace`. It also accepts more targeted Rust logging filters, such as
`zerocode_core=debug,zerocode_tui=debug`.

The interactive CLI records diagnostics in bounded local stores by default, but
the plaintext `zerocode-tui.log` file is opt-in. Set `log_dir` explicitly when you
need a plaintext log for troubleshooting:

```bash theme={null}
RUST_LOG=debug zerocode -c log_dir=./.zerocode-log
tail -F ./.zerocode-log/zerocode-tui.log
```

In non-interactive mode, `ZeroTwo desktop runs` prints messages inline instead of writing
to a separate TUI log file.
