# Read environment variables (/docs/guides/runtime/read-env)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 150 · updated: 2026-07-28 -->
Related: [Delete directories](/docs/guides/runtime/delete-directory.md), [Delete files](/docs/guides/runtime/delete-file.md), [Import a HTML file as text](/docs/guides/runtime/import-html.md), [Import a JSON file](/docs/guides/runtime/import-json.md), [Import a JSON5 file](/docs/guides/runtime/import-json5.md), [Import a TOML file](/docs/guides/runtime/import-toml.md)

Access the current environment variables with `process.env`.

```ts index.ts icon="/icons/typescript.svg"
process.env.API_TOKEN; // => "secret"
```

***

Bun also exposes these variables as `Bun.env`, an alias of `process.env`.

```ts index.ts icon="/icons/typescript.svg"
Bun.env.API_TOKEN; // => "secret"
```

***

To print all currently-set environment variables, run `bun --print process.env`.

```sh terminal icon="terminal"
bun --print process.env
```

```txt
{
  BAZ: "stuff",
  FOOBAR: "aaaaaa",
  <lots more lines>
}
```

***

See [Environment variables](/runtime/environment-variables).
