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

# cordon env

> Print scope-aware env vars to route traffic through cordon.

Print the environment variables a consumer needs to route traffic through cordon. Use the output in your shell, `.envrc` (direnv), `.mise.toml`, or any tooling that consumes env vars.

## Usage

```bash theme={null}
cordon env [OPTIONS]
```

## Options

| Option           | Description                                                |
| ---------------- | ---------------------------------------------------------- |
| `--scope`        | Configuration scope: `project` (default) or `user`         |
| `--config`, `-c` | Path to `cordon.toml` (overrides scope-resolved path)      |
| `--format`       | Output format: `shell` (default), `fish`, `dotenv`, `json` |

Unlike most config-reading commands, `--config` does not conflict with `--scope`; when provided, `--config` wins.

## Examples

Interactive shell (bash / zsh):

```bash theme={null}
eval "$(cordon env)"
```

fish:

```fish theme={null}
cordon env --format fish | source
```

direnv (`.envrc`):

```bash theme={null}
eval "$(cordon env)"
```

mise (`.mise.toml`):

```bash theme={null}
cordon env --format dotenv > .mise.cordon.env
```

JSON for scripting:

```bash theme={null}
cordon env --format json | jq .HTTPS_PROXY
```

## Output

Vars emitted:

* `HTTPS_PROXY` / `HTTP_PROXY` (plus lowercase) — `http://127.0.0.1:<port>`, port from `cordon.toml`.
* `NODE_EXTRA_CA_CERTS` — absolute path to the Cordon CA cert. Node.js expects a raw cert, not a bundle.
* `SSL_CERT_FILE` / `REQUESTS_CA_BUNDLE` / `CURL_CA_BUNDLE` — absolute path to the combined (system + Cordon) CA bundle. These env vars *replace* the default trust store, so a bundle is required.

See the [generic tool guide](/guides/generic) for where to apply these values and [SDK Compatibility](/guides/sdk-compatibility#runtime-ca-and-proxy-notes) for runtime-specific exceptions.

## Errors

* `no cordon.toml at <path> — run \`cordon setup\` first\` — no config at the resolved scope path.
* Bundle vars are omitted (with a comment) if `combined-ca.pem` is missing; run `cordon setup` to generate it.

## See also

* [`cordon setup`](setup) — generates the config and CA bundle this command depends on.
* [Any tool (generic)](/guides/generic) — manual proxy environment setup.
