env-all
v0.1.3
Published
Cross-project environment variable manager — store API keys once, use everywhere
Maintainers
Readme
env-all
Store your API keys once. Use them in every project.
Tired of copying the same OPENAI_API_KEY into every new project's .env? env-all keeps all your keys in one place (~/.env-global/.env) and lets you pull them into any project with a single command.
npm install -g env-allQuick Start
With Claude Code Skill
mkdir -p ~/.claude/skills/env
cp skill.md ~/.claude/skills/env/SKILL.mdThen type /env in Claude Code in any project. Claude will install env-all, scan your project for required env vars, and pull them from your global store automatically.
With the browser UI
npm install -g env-all
envall init
envall uiThis opens a split-screen editor with your global key store on the left and the current project's .env on the right. Add keys, copy values between sides, and manage everything visually.
CLI only
npm install -g env-all
envall init
# Add keys from the terminal (hidden input, not saved to shell history)
envall set OPENAI_API_KEY
envall set STRIPE_SECRET_KEY
# In any project, pull what you need
cd ~/my-project
envall pull OPENAI_API_KEY STRIPE_SECRET_KEYenv-all adds .env to your .gitignore automatically.
Why
- One source of truth. Stop maintaining the same keys across 15 projects.
- Rename on pull.
envall pull OPENAI_API_KEY:VITE_OPENAI_API_KEYhandles framework prefixes. - AI-friendly. AI coding assistants can scan your project, generate a
.env-pull.jsonmapping, and pull keys automatically -- without ever seeing the actual values. - Zero dependencies. Just
commanderfor CLI parsing. No runtime overhead in your projects. - Browser UI.
envall uiopens a split-screen editor showing your global keys alongside the current project's.env.
Commands
| Command | Description |
|---------|-------------|
| envall init | Create ~/.env-global/ directory |
| envall set KEY | Store a key (prompts for hidden input) |
| envall set KEY=VALUE | Store a key (value in shell history) |
| envall get KEY | Show a key (masked). Add --unmask for raw value |
| envall list | List all keys with masked values |
| envall rm KEY | Remove a key |
| envall open | Open ~/.env-global/.env in your editor |
| envall pull KEY [...] | Pull keys into project .env |
| envall pull file.json | Pull keys defined in a JSON mapping file |
| envall pull -i | Interactively pick keys to pull |
| envall status | Show sync status for current project |
| envall ui | Browser-based key manager |
All commands support --profile <name> for multiple environments (dev, staging, prod).
Pulling Keys
Basic
envall pull OPENAI_API_KEY DATABASE_URLRename on pull
When your framework needs a prefix:
envall pull OPENAI_API_KEY:VITE_OPENAI_API_KEY
envall pull OPENAI_API_KEY:NEXT_PUBLIC_OPENAI_API_KEYThe same global key can map to multiple project keys:
envall pull OPENAI_API_KEY OPENAI_API_KEY:VITE_OPENAI_API_KEYPull from a JSON mapping file
For projects with many keys or framework-specific prefixes, define a .env-pull.json once and reuse it:
{
"mappings": {
"OPENAI_API_KEY": "OPENAI_API_KEY",
"VITE_OPENAI_API_KEY": "OPENAI_API_KEY",
"NEXT_PUBLIC_STRIPE_KEY": "STRIPE_SECRET_KEY",
"DATABASE_URL": "DATABASE_URL"
}
}envall pull .env-pull.jsonThe left side is the key name your project expects, the right side is the key name in your global store. This lets you map one global key to multiple project keys with different names (e.g. framework prefixes like VITE_, NEXT_PUBLIC_).
Commit .env-pull.json to your repo so teammates (and AI assistants) can run envall pull .env-pull.json to set up their .env in one step.
Let your AI coding agent generate it
AI coding assistants like Claude Code can create .env-pull.json automatically. The agent:
- Scans your project source for
process.env.*,import.meta.env.*, SDK imports, and config files - Reads
~/.env-global/.env.available(key names only -- never the actual values) - Writes a
.env-pull.jsonmapping project needs to your available global keys - Runs
envall pull .env-pull.json --skip
The agent never sees your secrets. See the AI Assistant Integration section below for setup details.
Conflict handling
When a key already exists in your project .env with a different value, env-all prompts you:
Conflict: OPENAI_API_KEY
Local: sk-old...
Global: sk-new...
[s]kip / [o]verwrite / [S]kip all / [O]verwrite all:Or skip the prompt with --overwrite or --skip.
Profiles
Keep separate key sets for different environments:
envall set STRIPE_KEY --profile=prod
envall set STRIPE_KEY --profile=dev
envall pull STRIPE_KEY --profile=prod
envall list --profile=devEach profile is stored as ~/.env-global/.env.<name>.
Browser UI
envall uiOpens a split-screen editor in your browser with your global store on the left and the current project's .env on the right. Copy values to clipboard and paste where needed -- the same flow as copying keys from an API provider dashboard.
AI Assistant Integration
env-all is designed so AI coding assistants (Claude Code, Cursor, etc.) can set up project env vars without ever reading your actual keys.
How it works
~/.env-global/.env.availablecontains only key names (no values), auto-generated from your store.- The AI reads
.env.availableto see what keys you have. - The AI reads your project code to determine what keys it needs.
- The AI writes a
.env-pull.jsonmapping and runsenvall pull .env-pull.json. - The AI never sees
~/.env-global/.envor any actual values.
Claude Code skill
envall init offers to install the skill automatically. To install manually:
mkdir -p ~/.claude/skills/env
cp skill.md ~/.claude/skills/env/SKILL.mdThen run /env in any project to have Claude scan your code, generate a .env-pull.json mapping, and pull keys automatically.
Every time you modify the store (set, rm, open), env-all regenerates ~/.env-global/.env.available. This file contains one key name per line:
OPENAI_API_KEY
STRIPE_SECRET_KEY
DATABASE_URLNo values. This file is safe for AI assistants to read.
It's also regenerated at the start of pull and status, so manual edits to ~/.env-global/.env are always picked up.
~/.env-global/.envis created withchmod 600(owner read/write only).envall set KEYprompts for hidden input -- the value never appears in shell history.envall set KEY=VALUEwarns you about shell history exposure.envall getshows masked values by default.--unmaskis required for raw output.envall listalways masks values.envall pulloutput only shows key names, never values.envall uibinds to127.0.0.1only, with a one-time auth token in the URL.- Profile names are validated to prevent path traversal.
.envis added to.gitignoreautomatically on pull.
env-all stores keys unencrypted, the same as any .env file. It is designed for local development, not production secret management.
License
MIT
