Securely manage environment variables in your system keychain π
lpop stores your environment variables in the system keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service), making them secure and easy to manage.
- Never lose your secrets - Call
lpop .env.localto store all your secrets from an existing file - Delete your repos - when you clone again, just call
lpop .env.localto get your secrets back - Clone multiple times or use git trees - call
lpop .env.localand your secrets appear - Use with AI Coding tools - run Claude, or Cursor on 20 different copies of the repo, without ever giving it access to secrets
- Skip .env files entirely - Use
lpop env -- npm startto run commands with variables directly from keychain
# Install globally with npm
npm install -g @loggipop/lpoplpop automatically detects your git repository and organizes variables by project and environment:
π System Keychain
βββ π lpop://user/project
β βββ π API_KEY - repo level api key
β βββ π SECRET_TOKEN - repo level token
βββ π lpop://user/project?env=development
β βββ π DATABASE_URL - development database
βββ π lpop://user/project?env=production
βββ π DATABASE_URL - production database
# From a .env file
lpop .env.local
# Or add a single variable
lpop API_KEY=secret123# Get all variables and write to .env.local file
# Uses .env.example as template if available
lpop
# Or specify a different output file
lpop .env.dev# Store production variables
lpop .env.production --env production
# Retrieve staging variables
lpop --env staging# Run any command with keychain variables loaded
lpop env -- npm start
lpop env -- node server.js
lpop env -- bun dev
# Use with specific environments
lpop env --env production -- npm run build$ lpop .envπ Reading .env file...
π Storing in: lpop://acme/app
β
Added 3 variables:
β’ DATABASE_URL
β’ API_KEY
β’ JWT_SECRET
When you have a .env.example file, lpop uses it as a template:
.env.example:
# Database configuration
DATABASE_URL=
DB_PASSWORD=
# API configuration
API_KEY=
API_SECRET=Running lpop produces .env.local:
# Database configuration
DATABASE_URL=postgres://localhost:5432/mydb
DB_PASSWORD=
# API configuration
API_KEY=sk-1234567890abcdef
API_SECRET=
# Additional variables from keychain
EXTRA_VAR=some_value$ lpop --env productionπ Repository: github.com/acme/app
π Environment: production
β
3 variables written to .env.local using .env.example template
$ lpop env -- npm startRunning "npm start" with 3 variables from lpop://acme/app
> my-app@1.0.0 start
> node server.js
π Server running on port 3000 with API_KEY loaded from keychain
lpop intelligently determines what you want to do:
| Command | What it does |
|---|---|
lpop |
Get all variables and write to .env.local |
lpop .env |
Add/update variables from file |
lpop KEY=value |
Add/update a single variable |
lpop .env.dev |
Export variables to specific file |
lpop env -- <cmd> |
Run command with keychain variables |
Click to see all commands
lpop add .env # From file
lpop add "DB_URL=postgres://..." # Single variable
lpop add .env --env production # To specific environmentlpop get # All variables to .env.local
lpop get API_KEY # Specific variable
lpop get --env staging # From specific environmentlpop update .env # From file
lpop update "API_KEY=newsecret" # Single variablelpop remove API_KEY # Single variable
lpop clear --confirm # All variables (with confirmation)lpop list # Show all stored repositorieslpop env # Show variables that would be loaded
lpop env -- npm start # Run with keychain variables
lpop env --env prod -- bun build # Use specific environment# 1. Clone a project
git clone https://github.com/acme/project.git
cd project
# 2. Get the development environment variables
lpop
# 3. Start developing!
npm run dev# 1. Store your secrets once in keychain
lpop API_KEY=sk-secret123
lpop DATABASE_URL=postgres://localhost:5432/mydb
# 2. Delete .env files completely
rm .env .env.local .env.development
# 3. Run any command with variables from keychain
lpop env -- npm start
lpop env -- bun dev
lpop env -- python app.py
# Variables are loaded securely without ever touching disk!# Store different configs for each environment
lpop .env.development --env development
lpop .env.staging --env staging
lpop .env.production --env production
# Switch between them easily
lpop --env development # When developing
lpop --env staging # When testing
lpop --env production # When debugging prod- β Encrypted Storage: Variables are stored in your system's secure keychain
- β No Plain Text: Never stored in files or logs
- β Git-Aware: Automatically scoped to prevent cross-project leaks
- β Access Control: Protected by your system's authentication
Where are my variables stored?
Variables are stored in your operating system's secure credential storage:
- π macOS: Keychain Access
- πͺ Windows: Credential Manager
- π§ Linux: Secret Service API (gnome-keyring, KWallet, etc.)
What happens if I'm not in a git repository?
lpop will use the current directory name as the project identifier. Your variables will be stored as local/dirname?env=development.
Can I share variables with my team?
A share feature is coming real soon. For now, to share with your team:
- Export variables:
lpop .env.share - Share the file securely (encrypted email, password manager, etc.)
- Team members import:
lpop .env.share
How do I migrate from .env files?
Simply run lpop .env in each project directory. Your existing .env files will be imported into the secure keychain.
How does the .env.example template work?
When you run lpop and a .env.example file exists:
- Template Structure: Maintains organization and comments from
.env.example - Variable Matching: Keychain variables matching template keys get values inserted
- Additional Variables: Extra keychain variables are added at the end in alphabetical order
- Fallback: If
.env.exampledoesn't exist, uses standard format
What's the difference between `lpop` and `lpop env`?
lpop: Exports variables to a.env.localfile on disk (traditional approach)lpop env -- <command>: Runs commands with variables loaded directly from keychain (no files created)
Use lpop env when you want maximum security - no secrets ever touch disk. Perfect for security-conscious teams or when working with sensitive production data.
When switching between bun dev and the installed binary, macOS may prompt for keychain access. This is normal - the system sees them as different applications.
If you get permission errors, make sure you have access to your system's keychain/credential manager.
We love contributions! Please see our Contributing Guide for details.
tl;dr: Fork the repo, make your changes, and submit a pull request! π
MIT Β© Tom Beckenham
Made with π by the Loggipop team