🦀 crabenv
The simplest, opinionated way to keep .env files, schemas, and examples aligned.
crabenv is an env var management standard created by Carlo Taleon to minimize env var schema + documentation drift in any codebase. If you follow this standard, you'll find it extremely seamless to "develop locally" and "deploy to production" in any platform!
Why use it
- Typesafety & Validation
- Good documentation. Never stale, does what it says.
- Seamless local development to deployment story.
- No new config files. Your team doesn't need to install crabenv, it's just manual-crud made automated via CLI.
- Language-agnostic. No need to learn language-specific configurations for multi-language and monorepos, just use the same CLI commands.
Installation
|
Quickstart
💡 Before anything else, read this 1-page concept of the standard here. Must know Local (
.env), Schema (env.ts, etc.), Template (.env.example)
- This command auto-detects your project and creates a Local, Schema, and Template
- Add an env var
# Notice that Local, Template, and Schema are correctly synced 🎉
- List your env vars to see if it's used, remove, or update vars
😎 That's it! Now imagine the convenience when...
- A new dev onboards on a new project, they just need to do
crabenv cpto get a correct.envfile! It's a bettercp .env.example .envcommand! - A senior dev wants to deploy a monorepo so what env vars needed for specific apps? Show them all with
crabenv ls - A senior dev wants to reorganize, sort, standardize the structure of env vars? Re-sort them without thinking about it with
crabenv fmt - A senior dev wants to check for any drift?
crabenv doctor
📁 Languages supported:
Regardless of the language or mix of languages in your repositories, you'll be able to use the same commands.
- 💙 TypeScript/Javascript and Monorepos (includes React, Solid, Vue, Svelte, Vite, NextJS, ReactNative, Backends, and Cloudflare apps)
- 🐍 Python
- 🦀 Rust
- 🐦 Flutter
- More? Request an adapter.
Agent skill
Completely optional, but in case you want your agent to be autonomous when adding new env vars... Install the crabenv skill for coding agents with:
Useful commands you should know
# CRUD
# Type flags
# Custom regex
# ... essentially a cli version of zod
# Special environment overrides
} } } }
Documentation
License
MIT. Fork it if you want!