envex-0.4.1 is not a library.
envx
A powerful and secure environment variable manager for developers, featuring an intuitive Terminal User Interface (TUI) and comprehensive command-line interface.
๐ฅ Introduction Video
๐ธ Screenshots
๐ Features
- ๐ฅ๏ธ Interactive TUI: Beautiful terminal interface for easy environment variable management
- ๐ Smart Search: Fast filtering and searching across all environment variables
- ๐ Source Tracking: Distinguish between System, User, Process, Shell, and Application variables
- ๐ Multi-line Support: Edit complex environment variables with proper multi-line support
- ๐ Import/Export: Support for multiple formats (JSON, YAML, TOML, ENV)
- ๐ธ Snapshots & Profiles Feature Implementation: Save and restore variable states
- ๐ Project Configuration: Define required variables, defaults, and scripts for consistent team environments
- ๐ Watch Mode & Monitor: Monitor file changes and sync automatically, track environment modifications in real-time
- โก Performance: Built with Rust for blazing-fast performance
- ๐จ Cross-platform: Works on Windows, macOS, and Linux
๐ฆ Installation
From Source
Using Cargo
Pre-built Binaries
Download the latest release for your platform from the releases page.
๐ Quick Start
Launch the TUI
# or
List all environment variables
Set a variable
Get a variable
๐ Command Line Usage
Overview
)
)
Core Commands
list
- List environment variables
)
)
)
# List all variables
# List with a pattern
# List from specific source
get
- Get a specific variable
<PATTERN> Variable )
)
set
- Set an environment variable
<NAME> Variable
<VALUE> Variable
# Set for current session
# Set persistently (survives reboot)
delete
- Remove an environment variable
<PATTERN> Variable
)
analyze
- Analyze environment variables
)
path
- Manage PATH variable
)
)
Import/Export Commands
export
- Export variables to a file
<FILE> Output
)
)
)
)
import
- Import variables from a file
<FILE> Input
)
)
# Import from JSON
# Import from YAML
# Import from .env file
profiles
- Manage environment profiles
)
snapshots
- Manage environment snapshots
)
# Create a snapshot before deployment
# Restore if something goes wrong
# Compare snapshots
project
- Manage project-specific configuration
)
Usage Example
# Initialize a new project
# Add required variables
# Edit configuration
# Check if all required variables are set
# Apply configuration
# Run a project script
Example Configuration File
Here's what a typical .envx/config.yaml would look like:
name: my-web-app
description: Production web application
# Required environment variables
required:
- name: DATABASE_URL
description: PostgreSQL connection string
pattern: "^postgresql://.*"
example: "postgresql://user:pass@localhost/dbname"
- name: API_KEY
description: External API authentication key
- name: PORT
description: Server port number
pattern: "^[0-9]+$"
example: "3000"
# Default values (if not already set)
defaults:
NODE_ENV: development
LOG_LEVEL: info
PORT: "3000"
# Files to auto-load (in order)
auto_load:
- .env
- .env.local
- .env.${NODE_ENV}
# Profile to activate
profile: dev
# Scripts for common tasks
scripts:
dev:
description: Start development server
run: npm run dev
env:
NODE_ENV: development
DEBUG: "true"
test:
description: Run tests
run: npm test
env:
NODE_ENV: test
migrate:
description: Run database migrations
run: npm run migrate
# Validation rules
validation:
warn_unused: true
strict_names: true
patterns:
"*_URL": "^https?://.*"
"*_PORT": "^[0-9]{1,5}$"
# Create a snapshot before deployment
# Restore if something goes wrong
# Compare snapshots
rename
- Rename environment variables (supports wildcards)
<PATTERN> Pattern )
<REPLACEMENT> New
)
Example Usage
# Rename single variable
# Rename with wildcards
# Dry run to preview changes
replace
- Replace environment variable values
<PATTERN> Variable )
<VALUE> New
Example Usage
find-replace
- Find and replace text within environment variable values
<SEARCH> Text
<REPLACEMENT> Text
)
Example Usage
# Find and replace text within values
# Preview changes
watch
- Watch files for changes and auto-sync
)
)
)
)
Example Usage
# Watch .env file and apply changes to system
# Watch and sync system changes back to file
# Bidirectional sync
# Watch multiple files with patterns
# Watch with custom settings
monitor
- Monitor environment variable changes (read-only)
)
)
)
)
Example Usage
# Monitor all environment variables
# Monitor specific variables
# Show only changes (hide static vars)
# Monitor with logging
# Monitor variables from specific source
๐ฎ TUI Keyboard Shortcuts
Normal Mode
โ
/โ
orj
/k
- Navigate up/downPageUp
/PageDown
- Navigate by pageHome
/End
- Jump to first/last itemEnter
orv
- View variable details/
- Enter search modea
- Add new variablee
- Edit selected variabled
- Delete selected variabler
- Refresh listq
- Quit
Search Mode
Esc
- Cancel searchEnter
- Apply search
Edit Mode
Tab
- Switch between name and value fieldsCtrl+Enter
- Save changesEsc
- Cancel editing
๐ง Configuration
envx stores its configuration in platform-specific locations:
- Windows:
%APPDATA%\envx\config.toml
- macOS:
~/Library/Application Support/envx/config.toml
- Linux:
~/.config/envx/config.toml
Example Configuration
[]
= "json"
= true
= 100
[]
= "dark"
= true
๐๏ธ Architecture
envx is built with a modular architecture:
- envx-core: Core functionality for environment variable management
- envx-cli: Command-line interface implementation
- envx-tui: Terminal User Interface
- envx: Main binary that ties everything together
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- 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
Development Setup
# Clone the repository
# Build the project
# Run tests
# Run with debug logging
RUST_LOG=debug
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
๐ Benchmarks
envx is designed for performance:
- List 1000+ variables: < 10ms
- Search through variables: < 5ms
- Import/Export operations: < 50ms for typical workloads
Debug Mode
Run with debug logging enabled:
RUST_LOG=debug
๐ง Contact
- Author: Mikko Leppรคnen
- Email: mleppan23@gmail.com
- GitHub: @mikeleppane