Bun Environment Variables

Read and configure environment variables in Bun, including automatic .env file support

9 stars 1 forksOther

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add jarle/bun-skills --skill Bun Environment Variables
Manual install
git clone --depth 1 https://github.com/jarle/bun-skills.git /tmp/bun-skills
mkdir -p ~/.claude/skills
cp -r /tmp/bun-skills/skills/bun-runtime-environment-variables ~/.claude/skills/Bun-Environment-Variables

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Environment Variables

> Read and configure environment variables in Bun, including automatic .env file support

Bun reads your `.env` files automatically and provides idiomatic ways to read and write your environment variables programmatically. Plus, some aspects of Bun's runtime behavior can be configured with Bun-specific environment variables.

## Setting environment variables

Bun reads the following files automatically (listed in order of increasing precedence).

* `.env`
* `.env.production`, `.env.development`, `.env.test` (depending on value of `NODE_ENV`)
* `.env.local`

```ini .env icon="settings" theme={"theme":{"light":"github-light","dark":"dracula"}}
FOO=hello
BAR=world
```

Variables can also be set via the command line.

<CodeGroup>
  ```sh Linux/macOS icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
  FOO=helloworld bun run dev
  ```

  ```sh Windows icon="windows" theme={"theme":{"light":"github-light","dark":"dracula"}}
  # Using CMD
  set FOO=helloworld && bun run dev

  # Using PowerShell
  $env:FOO="helloworld"; bun run dev
  ```
</CodeGroup>

<Accordion title="Cross-platform solution with Windows">
  For a cross-platform solution, you can use [bun shell](/runtime/shell). For example, the `bun exec` command.

  ```sh  theme={"theme":{"light":"github-light","dark":"dracula"}}
  bun exec 'FOO=helloworld bun run dev'
  ```
Read the full skill on GitHub

Details

Skill name
Bun Environment Variables
Path
skills/bun-runtime-environment-variables/SKILL.md
License
MIT
Repo updated
24 February 2026

FAQ

What does the Bun Environment Variables skill do?

Read and configure environment variables in Bun, including automatic .env file support

How do I install the Bun Environment Variables skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add jarle/bun-skills --skill Bun Environment Variables. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Bun Environment Variables popular?

It lives in jarle/bun-skills, which has 9 GitHub stars and 1 forks.

Related skills

Browse the most popular Claude skills, all other skills, or write your own with the skills generator.