Lightning-fast environment variable management for modern developers.
A blazingly fast, local-first CLI tool to manage environment variables across all your projects. Zero setup, zero servers, zero hassle.
Features • Installation • Quick Start • Documentation • Contributing
Managing environment variables shouldn't require a PhD. envx is built for solo developers who want:
- Instant access to env vars across projects
- Zero configuration - just install and go
- Local-first - no servers, no cloud, no complexity
- One command to switch between dev/staging/prod
Stop juggling .env files. Stop losing configurations. Stop the chaos.
envx makes environment management invisible.
- Blazingly Fast - Written in Go, optimized for speed
- Multi-Project - Manage unlimited projects from one place
- Multi-Environment - Dev, staging, production profiles
- Import/Export - Works seamlessly with
.envfiles - Secure Storage - Encrypted values for sensitive data (Phase 4)
- Smart Templates - Share env structure without secrets
- Cross-Platform - macOS, Linux, Windows support
- Beautiful CLI - Intuitive interface, clear output
- Git-Friendly - Optional version control integration
- Zero Dependencies - Single binary, no runtime required
go install github.com/aminhaiqal/envx@latest# Coming soon
brew install envxGrab the latest release for your platform from the releases page.
git clone https://github.com/aminhaiqal/envx.git
cd envx
go build -o envx cmd/envx/main.goenvx init myappenvx set myapp DATABASE_URL="postgresql://localhost:5432/mydb"
envx set myapp API_KEY="sk-your-secret-key-here"
envx set myapp PORT=3000
envx set myapp NODE_ENV="development"envx list myappOutput:
📦 myapp (development)
DATABASE_URL postgresql://localhost:5432/mydb
API_KEY sk-*********************here
PORT 3000
NODE_ENV development
4 variables
envx export myapp
# ✓ Exported to .env# Generate .env and start your app
envx export myapp && npm run dev
# Quick export for different environments
envx export myapp --env production -o .env.prodInitialize a new project profile.
# Create a new project
envx init myapp
# Create with specific environment
envx init myapp --env production
# Create with description
envx init myapp --desc "My awesome API"Flags:
--env, -e- Environment name (default: development)--desc, -d- Project description
Set an environment variable.
# Set a variable
envx set myapp DATABASE_URL="postgresql://localhost:5432/db"
# Set for specific environment
envx set myapp API_URL="https://api.prod.com" --env production
# Set with description (helpful for team templates)
envx set myapp SECRET_KEY="xxx" --desc "OAuth secret key"
# Set multiple at once
envx set myapp KEY1=value1 KEY2=value2 KEY3=value3Flags:
--env, -e- Target environment--desc, -d- Variable description--secret, -s- Mark as secret (masked in list)
Retrieve a specific variable value.
# Get a variable
envx get myapp DATABASE_URL
# Get from specific environment
envx get myapp API_URL --env production
# Copy to clipboard
envx get myapp API_KEY --copyFlags:
--env, -e- Source environment--copy, -c- Copy value to clipboard
List all environment variables for a project.
# List all variables (secrets masked)
envx list myapp
# Show all values including secrets
envx list myapp --show-secrets
# List specific environment
envx list myapp --env production
# Export as JSON
envx list myapp --jsonFlags:
--env, -e- Target environment--show-secrets- Display secret values--json- Output as JSON
Delete an environment variable.
# Delete a variable
envx rm myapp OLD_CONFIG
# Delete from specific environment
envx rm myapp TEMP_KEY --env staging
# Delete multiple
envx rm myapp KEY1 KEY2 KEY3Flags:
--env, -e- Target environment--force, -f- Skip confirmation
Export variables to a .env file.
# Export to .env in current directory
envx export myapp
# Export to custom path
envx export myapp --output ./config/.env.local
# Export specific environment
envx export myapp --env production --output .env.prod
# Export with comments
envx export myapp --with-commentsFlags:
--env, -e- Source environment--output, -o- Output file path (default: .env)--with-comments- Include variable descriptions as comments--overwrite- Overwrite existing file without prompt
Import variables from an existing .env file.
# Import from .env file
envx import myapp .env
# Import to specific environment
envx import myapp .env.production --env production
# Merge without overwriting existing values
envx import myapp .env --merge
# Dry run (preview changes)
envx import myapp .env --dry-runFlags:
--env, -e- Target environment--merge- Don't overwrite existing variables--dry-run- Preview import without applying
Clone a project profile.
# Clone entire project
envx clone myapp myapp-backup
# Clone to different environment
envx clone myapp myapp-staging --env staging
# Clone specific environment only
envx clone myapp myapp-prod --from production --to productionFlags:
--env, -e- Target environment for destination--from- Source environment--to- Destination environment
Generate a template file (variable names without values).
# Output to stdout
envx template myapp
# Save to file
envx template myapp --output .env.template
# Include descriptions
envx template myapp --with-desc > .env.exampleFlags:
--output, -o- Output file path--with-desc- Include variable descriptions--env, -e- Source environment
List all managed projects.
# List all projects
envx projects
# Show detailed info
envx projects --detailed
# Filter by environment
envx projects --env productionFlags:
--detailed, -d- Show variable counts and descriptions--env, -e- Filter by environment
Set the default environment for a project.
# Switch default environment
envx switch myapp production
# Now all commands use production by default
envx list myapp # Lists production envList all environments for a project.
envx envs myapp
# Output:
# development (default)
# staging
# productionenvx stores data locally in a secure location:
Storage locations:
- macOS/Linux:
~/.config/envx/ - Windows:
%APPDATA%\envx\
Configuration file:
~/.config/envx/config.json
Project data:
~/.config/envx/projects/<project-name>.json
envx/
├── cmd/
│ └── envx/
│ └── main.go # CLI entry point
├── internal/
│ ├── storage/
│ │ ├── storage.go # Storage interface
│ │ ├── json.go # JSON storage
│ │ └── encrypted.go # Encrypted storage (Phase 4)
│ ├── config/
│ │ └── config.go # Config management
│ ├── profile/
│ │ ├── profile.go # Profile operations
│ │ └── environment.go # Environment handling
│ ├── exporter/
│ │ ├── dotenv.go # .env export
│ │ └── template.go # Template generation
│ └── importer/
│ └── dotenv.go # .env import
├── pkg/
│ └── envx/
│ ├── vault.go # Core operations
│ ├── types.go # Data structures
│ └── validator.go # Input validation
├── tests/
│ ├── unit/
│ └── integration/
├── docs/
│ ├── getting-started.md
│ ├── best-practices.md
│ └── faq.md
├── go.mod
├── go.sum
├── README.md
├── LICENSE
├── .goreleaser.yml
└── .github/
└── workflows/
├── test.yml
├── release.yml
└── lint.yml
- Go 1.21 or higher
- Git
- Make (optional)
# Clone the repository
git clone https://github.com/aminhaiqal/envx.git
cd envx
# Install dependencies
go mod download
# Build
make build
# OR
go build -o envx cmd/envx/main.go
# Run
./envx --help# Run all tests
make test
# OR
go test ./...
# Run with coverage
make test-coverage
# OR
go test -cover ./...
# Run integration tests
go test ./tests/integration/... -v
# Run benchmarks
go test -bench=. ./...# Run linter
golangci-lint run
# Format code
gofmt -s -w .
# Vet code
go vet ./...- Project initialization
- Basic CRUD operations (set, get, list, rm)
- Export to .env
- Import from .env
- Cross-platform file handling
- Multiple environment profiles per project
- Environment switching
- Default environment management
- Environment listing
- Beautiful CLI output with colors
- Template generation
- Profile cloning
- Bulk operations
- Better error messages
- Encrypted value storage
- Master password protection
- Secure value masking
- Audit logging
- Git integration (commit env changes)
- Variable validation and schemas
- Shell completions (bash, zsh, fish)
- Interactive TUI mode
- Cloud backup (optional)
- Team sharing (encrypted exports)
- Docker integration
- Kubernetes secrets export
- Plugin system
This project covers essential Go concepts:
Go Fundamentals:
- Project structure and package organization
- Error handling patterns
- File I/O and path management
- JSON encoding/decoding
- Command-line interfaces with Cobra
- Cross-platform development
Software Engineering:
- Clean architecture principles
- Test-driven development
- API design
- State management
- Security best practices
DevOps & Distribution:
- CI/CD with GitHub Actions
- Automated releases with GoReleaser
- Cross-platform builds
- Package distribution
Contributions make open source amazing! Whether you're fixing bugs, adding features, or improving docs—all contributions are welcome.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Write tests for new features
- Follow Go conventions and best practices
- Update documentation for user-facing changes
- Keep commits atomic and descriptive
- Run tests before submitting PR
- Add examples for new commands
Look for issues labeled good-first-issue to get started!
- Bug Reports: Open an issue
- Feature Requests: Open an issue
- Discussions: GitHub Discussions
- Docs: Wiki
Distributed under the MIT License. See LICENSE for more information.
If envx makes your dev life easier, consider:
- Starring this repo
- Sharing on Twitter
- Writing about your experience
- Contributing code or docs
- Built with Cobra for CLI framework
- Inspired by the need for simpler env management
- Thanks to all contributors who make this project better
Amin Haiqal
- GitHub: @aminhaiqal
- LinkedIn: linkedin.com/in/amin-haiqal
Project Link: https://github.com/aminhaiqal/envx
Built with ❤️ and Go by a developer, for developers