bun-env-file-for-dev

Configure Bun startup commands with the --env-file flag for local development.

2|Updated May 10, 2026
One-click install
npx skills add https://github.com/freedomw1987/tree_monstor --skill bun-env-file-for-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bun-env-file-for-dev
Source: https://github.com/freedomw1987/tree_monstor/tree/main/skills/bun-env-file-for-dev
Command: npx skills add https://github.com/freedomw1987/tree_monstor --skill bun-env-file-for-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Bun runtime does not automatically load .env files during local development, unlike Node.js, leading to undefined environment variables for dependent tools and services. This causes silent failures or obscure errors for AWS SDK calls, Prisma database operations, and boot-time secret validation in Bun dev servers.

Core Features & Use Cases

  • Provides the correct Bun startup command with the --env-file flag to load .env variables properly
  • Resolves AWS SDK v3 region and credential errors caused by missing environment variables in local development
  • Fixes edge cases including Prisma seed scripts not inheriting parent process env flags, current working directory path traps for .env loading, and boot-time secret testing pitfalls
  • Use Case: A developer building a Bun backend with AWS SES integration can use this skill to ensure SES region and credential env vars load correctly, so email sending works in local dev without 500 errors.

Quick Start

Use this skill to fix undefined environment variable errors in your Bun dev server by applying the correct --env-file flag to your startup command, ensuring AWS SDK and other dependent tools work properly in local development.

Frequently Asked Questions about bun-env-file-for-dev

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Bun dev server return undefined environment variables for AWS SDK?

Bun dev server returns undefined environment variables because the Bun runtime does not automatically load .env files during local development like Node.js does. You must explicitly pass the --env-file flag to your Bun startup command to ensure AWS SDK calls work properly.

How do I load .env files when starting a local development server with Bun?

To load .env files when starting a local development server with Bun, you must apply the --env-file flag to your Bun startup command. This ensures environment variables are properly passed to dependent tools and boot-time secret validation succeeds.

Do Prisma seed scripts inherit environment variables from the parent Bun process?

Prisma seed scripts may fail to inherit environment variables from the parent Bun process if the --env-file flag is not correctly handled. You must configure child process environment inheritance properly to ensure Prisma database operations receive the necessary variables.

What causes current working directory path traps when loading .env files in Bun?

Current working directory path traps occur when loading .env files in Bun because the runtime fails to resolve environment file paths correctly relative to the execution directory. This causes silent failures or obscure errors for dependent tools and services.

Can I use Bun for local backend development involving AWS SES integration?

You can use Bun for local backend development with AWS SES integration by applying the correct --env-file flag to your startup command. This ensures SES region and credential environment variables load correctly, preventing 500 errors during email sending.

What is the best way to fix boot-time secret validation failures in a Bun dev server?

The best way to fix boot-time secret validation failures in a Bun dev server is to apply the correct --env-file flag to your startup command. This properly loads .env variables before the server starts, ensuring all secret validation checks pass.