Bun Environment Variables
Read and configure environment variables in Bun, including automatic .env file support
Install
npx skills add jarle/bun-skills --skill Bun Environment Variablesgit 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-VariablesPersonal 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'
```Details
- Skill name
Bun Environment Variables- Repository
- jarle/bun-skills
- 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
Bun Archive
9jarle/bun-skills
Create and extract tar archives with Bun's fast native implementation
Bun Auto Install
9jarle/bun-skills
Bun's automatic package installation feature for standalone script execution
Bun Bun Add
9jarle/bun-skills
Add packages to your project with Bun's fast package manager
Bun File Types
9jarle/bun-skills
File types and loaders supported by Bun's bundler and runtime
Bun Cookies
9jarle/bun-skills
Use Bun's native APIs for working with HTTP cookies
Bun Glob
9jarle/bun-skills
Use Bun's fast native implementation of file globbing
Browse the most popular Claude skills, all other skills, or write your own with the skills generator.