better-env

작성자: neondatabase

에이전트와 인간을 위한 더 나은 환경 변수 관리로, 완전한 타입 안전성, CLI 기반 원격 환경 동기화, 환경 검증을 제공합니다.…

npx skills add https://github.com/neondatabase/better-env --skill better-env

Work With better-env In A Repo

Type-safe environment config modules

Follow this best practice to manage environment variables in TypeScript applications with full type safety and clear server/public boundaries.

better-env exports configSchema to define typed env modules and recommends placing them in feature-level config.ts files (for example src/lib/auth/config.ts and src/lib/database/config.ts).

Learn more:

  • references/config-schema.md

Validate existence of all env variables in the current environment

Run env validation early so missing or invalid values fail fast before dev, build, or deploy steps.

better-env validate --environment <name> loads .env* files with Next.js semantics, discovers src/lib/*/config.ts modules, and checks every declared variable from your configSchema modules.

If your dotenv files intentionally include keys that are not referenced by config modules, add per-env suppressions in better-env.ts:

environments.<env>.ignoreUnused: string[]

These suppress only the selected local environment during validate. Adapter defaults are merged in automatically; for Vercel, VERCEL_OIDC_TOKEN is ignored by default in development, preview, and production.

Learn more:

  • references/env-validation.md

Configure runtime syncing between local files and hosted providers

Use runtime configuration to keep local dotenv targets aligned with provider environments while preserving safe defaults.

Create better-env.ts with defineBetterEnv(...) and an adapter (vercelAdapter, netlifyAdapter, railwayAdapter, or cloudflareAdapter).

For a standard Vercel setup, prefer the minimal config:

export default defineBetterEnv({ adapter: vercelAdapter() });

Do not add an environments block when it only duplicates adapter defaults. Add environments only when you intentionally need custom mappings, custom env files, or per-environment ignoreUnused behavior.

Learn more:

  • references/config.md
  • references/runtime.md

Use the CLI for day-to-day environment operations

The CLI gives a consistent workflow for initialization, sync, validation, and remote variable management, which is great for local development and CI automation.

Choose the command runner to match the repo:

  • Use npx in npm/pnpm-based repos (for example lockfiles like package-lock.json or pnpm-lock.yaml and scripts run via npm/pnpm).
  • Use bunx in Bun-based repos (for example bun.lock and scripts run via bun).
  • Keep commands aligned with the project's existing package manager/runtime conventions; do not mix runners unless the repo already does.

Recommended flow in a repo:

  1. Run better-env init once to verify adapter prerequisites.
  2. Run better-env pull --environment <name> to sync local env files.
  3. Run better-env validate --environment <name> before app startup/build.
  4. Use add, upsert, update, delete, and load for remote env changes.

Choose command behavior intentionally:

  • upsert for idempotent automation and scripts
  • add when duplicate keys should fail
  • update when missing keys should fail
  • delete to remove remote keys
  • load for batch updates from dotenv files

Learn more:

  • references/cli.md
  • references/vercel-adapter.md

neondatabase의 다른 스킬

claimable-postgres
neondatabase
로컬 개발, 데모, 프로토타이핑 및 테스트 환경을 위한 즉시 사용 가능한 Postgres 데이터베이스입니다. 계정이 필요하지 않습니다. 데이터베이스는 Neon 계정에 클레임되지 않으면 72시간 후에 만료됩니다.
official
neon-postgres-branches
neondatabase
이 스킬의 결과는 생성된 Neon 브랜치(또는 생성이 진행될 수 없는 경우 명확하고 실행 가능한 다음 단계)여야 합니다. 올바른 브랜치 유형을 선택한 다음 MCP 또는 CLI를 통해 브랜치 생성을 실행합니다.
official
neon-postgres-egress-optimizer
neondatabase
사용자가 Postgres 데이터베이스에서 과도한 데이터 전송(이그레스)을 유발하는 애플리케이션 측 쿼리 패턴을 진단하고 수정하도록 안내합니다. 대부분의 높은 이그레스 비용은 애플리케이션이 실제 사용하는 데이터보다 더 많은 데이터를 가져오기 때문에 발생합니다.
official
plugin-manager
neondatabase
이 저장소의 Cursor와 Claude Code 전반에 걸쳐 플러그인 구조와 구성을 관리합니다. 플러그인 폴더를 생성, 업데이트 또는 검토할 때 사용하세요…
official
skill-creator
neondatabase
효과적인 스킬을 생성하기 위한 가이드입니다. 이 스킬은 사용자가 Claude의 기능을 확장하는 새로운 스킬을 만들거나 기존 스킬을 업데이트하려 할 때 사용해야 합니다.
official
add-neon-docs
neondatabase
사용자가 Neon에 대한 문서 추가, 문서 추가, 참조 추가, 또는 문서 설치를 요청할 때 이 스킬을 사용하세요. Neon 모범 사례 참조 링크를 추가합니다…
official
neon-auth
neondatabase
애플리케이션에 Neon Auth를 설정합니다. 인증을 구성하고, 인증 라우트를 생성하며, UI 컴포넌트를 생성합니다. Next.js에 인증을 추가할 때 사용합니다.
official
neon-drizzle
neondatabase
완전한 기능을 갖춘 Drizzle ORM 설정을 프로비저닝된 Neon 데이터베이스와 함께 생성합니다. 종속성을 설치하고, 데이터베이스 자격 증명을 프로비저닝하며, 연결을 구성하고,…
official