Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
andrelandgraf avatar

Better Env

  • 49 installs
  • 18 repo stars
  • Updated June 8, 2026
  • andrelandgraf/fullstackrecipes

better-env is a Claude Code skill for managing environment variables with type safety, CLI-based remote sync, and validation across Vercel, Netlify, Railway, Cloudflare, and Fly.io.

About

This skill covers better-env, a tool for typed environment variable management with CLI-based remote sync and validation. It shows how to define typed config modules with configSchema, validate that all declared env variables exist per environment, and keep local dotenv files in sync with hosted providers. Developers use it when setting up typed config schemas, validating env vars, or managing remote env vars across Vercel, Netlify, Railway, Cloudflare, and Fly.io.

  • Type-safe env config modules with configSchema
  • Env validation that fails fast before dev/build/deploy
  • CLI sync of remote env vars across Vercel, Netlify, Railway, Cloudflare, Fly.io

Better Env by the numbers

  • 49 all-time installs (skills.sh)
  • Ranked #734 of 1,435 DevOps & CI/CD skills by installs in the Skillselion catalog
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

better-env capabilities & compatibility

Capabilities
env management · config validation · secrets sync
Works with
vercel · cloudflare
Use cases
devops · ci cd
Pricing
Free
From the docs

What better-env says it does

Better environment variable management for agents and humans with full type safety, CLI-based remote environment synchronization, and environment validation.
SKILL.md
Run env validation early so missing or invalid values fail fast before `dev`, `build`, or deploy steps.
SKILL.md
npx skills add https://github.com/andrelandgraf/fullstackrecipes --skill better-env

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs49
repo stars18
Last updatedJune 8, 2026
Repositoryandrelandgraf/fullstackrecipes

What it does

Define typed env config, validate variables per environment, and sync remote env vars across hosting providers with better-env.

Who is it for?

Developers setting up typed env config, validating env vars, or syncing remote env across providers.

When should I use this skill?

Setting up typed config schemas, validating env variables, or managing remote env vars.

What you get

Env variables are typed and validated early, and local dotenv files stay aligned with provider environments.

  • Typed config.ts modules
  • better-env.ts runtime config
  • Env validation step

By the numbers

  • Four adapters: vercel, netlify, railway, cloudflare
  • Five CLI mutation commands: add, upsert, update, delete, load

Files

SKILL.mdMarkdownGitHub ↗

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), then define environment mappings, env-file targets, and gitignore 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.

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

Related skills

FAQ

How do I validate env vars?

Run better-env validate --environment <name>, which loads .env* files and checks every variable declared in configSchema modules.

Which command is idempotent?

Use upsert for idempotent automation and scripts; add fails on duplicates, update fails on missing keys.

DevOps & CI/CDdeployinfra

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.