Crates.io | envex |
lib.rs | envex |
version | 0.4.0 |
created_at | 2025-08-27 08:55:36.254255+00 |
updated_at | 2025-08-29 12:17:02.375479+00 |
description | A modern, cross-platform environment variable manager with TUI and CLI interfaces |
homepage | https://github.com/mikeleppane/envx |
repository | https://github.com/mikeleppane/envx |
max_upload_size | |
id | 1812331 |
size | 77,064 |
A powerful and secure environment variable manager for developers, featuring an intuitive Terminal User Interface (TUI) and comprehensive command-line interface.
Envx's Main Page
Envx's Search Dialog
Envx's View Dialog
Envx's CLI Query Command
git clone https://github.com/yourusername/envx.git
cd envx
cargo install --path crates/envx
cargo install envex
Download the latest release for your platform from the releases page.
envx tui
# or
envx ui
envx list
envx set MY_VAR "my value"
envx get MY_VAR
System Environment Variable Manager
Usage: envx.exe <COMMAND>
Commands:
list List environment variables
get Get a specific environment variable
set Set an environment variable
delete Delete environment variable(s)
analyze Analyze environment variables
tui Launch the TUI [aliases: ui]
path Manage PATH variable
export Export environment variables to a file
import Import environment variables from a file
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
list
- List environment variablesList environment variables
Usage: envx.exe list [OPTIONS]
Options:
-s, --source <SOURCE> Filter by source (system, user, process, shell)
-q, --query <QUERY> Search query
-f, --format <FORMAT> Output format (json, table, simple, compact) [default: table]
--sort <SORT> Sort by (name, value, source) [default: name]
--names-only Show only variable names
-l, --limit <LIMIT> Limit output to N entries
--stats Show statistics summary
-h, --help Print help
# List all variables
envx list
# List with a pattern
envx list --format table --sort name --query RUST
# List from specific source
envx list --source system
envx list --source user
get
- Get a specific variableGet a specific environment variable
Usage: envx.exe get [OPTIONS] <PATTERN>
Arguments:
<PATTERN> Variable name or pattern (supports *, ?, and /regex/)
Examples:
envx get PATH - exact match
envx get PATH* - starts with PATH
envx get *PATH - ends with PATH
envx get *PATH* - contains PATH
envx get P?TH - P followed by any char, then TH
envx get /^JAVA.*/ - regex pattern
Options:
-f, --format <FORMAT> Output format (simple, detailed, json) [default: simple]
-h, --help Print help
envx get PATH
envx get MY_CUSTOM_VAR
envx get RUST*
set
- Set an environment variableSet an environment variable
Usage: envx.exe set [OPTIONS] <NAME> <VALUE>
Arguments:
<NAME> Variable name
<VALUE> Variable value
Options:
-p, --permanent Make change permanent
-h, --help Print help
# Set for current session
envx set MY_VAR "value"
# Set persistently (survives reboot)
envx set MY_VAR "value" --permanent
delete
- Remove an environment variableDelete environment variable(s)
Usage: envx.exe delete [OPTIONS] <PATTERN>
Arguments:
<PATTERN> Variable name or pattern
Options:
-f, --force Force deletion without confirmation
-h, --help Print help
envx delete MY_VAR
envx delete TEMP_VAR
envx delete /JAVA.*/
analyze
- Analyze environment variablesAnalyze environment variables
Usage: envx.exe analyze [OPTIONS]
Options:
-a, --analysis-type <ANALYSIS_TYPE> Type of analysis (duplicates, invalid) [default: all]
-h, --help Print help
envx analyze --analysis-type duplicates
envx analyze --analysis-type invalid
path
- Manage PATH variableManage PATH variable
Usage: envx.exe path [OPTIONS] [COMMAND]
Commands:
add Add a directory to PATH
remove Remove a directory from PATH
clean Clean invalid/non-existent entries from PATH
dedupe Remove duplicate entries from PATH
check Check PATH for issues
list Show PATH entries in order
move Move a PATH entry to a different position
help Print this message or the help of the given subcommand(s)
Options:
-c, --check Check if all paths exist
-v, --var <VAR> Target PATH variable (PATH, Path, or custom like PYTHONPATH) [default: PATH]
-p, --permanent Apply changes permanently
-h, --help Print help
export
- Export variables to a fileExport environment variables to a file
Usage: envx.exe export [OPTIONS] <FILE>
Arguments:
<FILE> Output file path
Options:
-v, --vars <VARS> Variable names or patterns to export (exports all if not specified)
-f, --format <FORMAT> Export format (auto-detect from extension, or: env, json, yaml, txt)
-s, --source <SOURCE> Include only specific sources (system, user, process, shell)
-m, --metadata Include metadata (source, modified time)
--force Overwrite existing file without confirmation
-h, --help Print help
envx export --vars RUST* .env
envx export variables.json --format json --source user
envx export variables.yaml --format yaml --source system
envx export variables.toml --format toml --source process
envx export .env --format env --source shell
import
- Import variables from a fileImport environment variables from a file
Usage: envx.exe import [OPTIONS] <FILE>
Arguments:
<FILE> Input file path
Options:
-v, --vars <VARS> Variable names or patterns to import (imports all if not specified)
-f, --format <FORMAT> Import format (auto-detect from extension, or: env, json, yaml, txt)
-p, --permanent Make imported variables permanent
--prefix <PREFIX> Prefix to add to all imported variable names
--overwrite Overwrite existing variables without confirmation
-n, --dry-run Dry run - show what would be imported without making changes
-h, --help Print help
# Import from JSON
envx import variables.json
# Import from YAML
envx import variables.yaml --format yaml
# Import from .env file
envx import .env --format env
profiles
- Manage environment profilesManage environment profiles
Usage: envx.exe profile <COMMAND>
Commands:
create Create a new profile
list List all profiles
show Show current or specific profile
switch Switch to a profile
add Add a variable to a profile
remove Remove a variable from a profile
delete Delete a profile
export Export a profile
import Import a profile
apply Apply a profile to current environment
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
envx profile create dev
envx profile add dev NODE_ENV development
envx profile switch dev --apply
envx profile export dev > dev-profile.json
snapshots
- Manage environment snapshotsManage environment snapshots
Usage: envx.exe snapshot <COMMAND>
Commands:
create Create a new snapshot
list List all snapshots
show Show details of a snapshot
restore Restore from a snapshot
delete Delete a snapshot
diff Compare two snapshots
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
# Create a snapshot before deployment
envx snapshot create "pre-deployment-v1.2"
# Restore if something goes wrong
envx snapshot restore "pre-deployment-v1.2"
# Compare snapshots
envx snapshot diff "pre-deployment-v1.2" "current"
project
- Manage project-specific configurationManage project-specific configuration
Usage: envx.exe project <COMMAND>
Commands:
init Initialize a new project configuration
apply Apply project configuration
check Validate project configuration
edit Edit project configuration
info Show project information
run Run a project script
require Add a required variable
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
# Initialize a new project
cd my-project
envx init --name "My Web App"
# Add required variables
envx project require DATABASE_URL --description "PostgreSQL connection" --pattern "^postgresql://.*"
envx project require API_KEY --description "API authentication key"
# Edit configuration
envx project edit
# Check if all required variables are set
envx project check
# Apply configuration
envx project apply
# Run a project script
envx project run dev
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
envx snapshot create "pre-deployment-v1.2"
# Restore if something goes wrong
envx snapshot restore "pre-deployment-v1.2"
# Compare snapshots
envx snapshot diff "pre-deployment-v1.2" "current"
rename
- Rename environment variables (supports wildcards)Rename environment variables (supports wildcards)
Usage: envx.exe rename [OPTIONS] <PATTERN> <REPLACEMENT>
Arguments:
<PATTERN> Pattern to match (supports wildcards with *)
<REPLACEMENT> New name or pattern
Options:
--dry-run Dry run - show what would be renamed without making changes
-h, --help Print help
# Rename single variable
envx rename MY_API MY_API2
# Rename with wildcards
envx rename APP_* MY_APP_*
envx rename *_OLD *_NEW
envx rename TEST_* PROD_*
# Dry run to preview changes
envx rename APP_* MY_APP_* --dry-run
replace
- Replace environment variable valuesReplace environment variable values
Usage: envx.exe replace [OPTIONS] <PATTERN> <VALUE>
Arguments:
<PATTERN> Variable name or pattern (supports wildcards with *)
<VALUE> New value to set
Options:
--dry-run Dry run - show what would be replaced without making changes
-h, --help Print help
envx replace MY_VAR "new value"
envx replace API_* REDACTED
find-replace
- Find and replace text within environment variable valuesFind and replace text within environment variable values
Usage: envx.exe find-replace [OPTIONS] <SEARCH> <REPLACEMENT>
Arguments:
<SEARCH> Text to search for in values
<REPLACEMENT> Text to replace with
Options:
-p, --pattern <PATTERN> Only search in variables matching this pattern (supports wildcards)
--dry-run Dry run - show what would be replaced without making changes
-h, --help Print help
# Find and replace text within values
envx find-replace localhost production.server.com
envx find-replace "C:\old\path" "C:\new\path" --pattern "*_PATH"
# Preview changes
envx find-replace localhost prod.com --dry-run
watch
- Watch files for changes and auto-syncWatch files for changes and auto-sync
Usage: envx.exe watch [OPTIONS] [PATH]...
Arguments:
[PATH]...
Files or directories to watch (defaults to current directory)
Options:
-d, --direction <DIRECTION>
Sync direction
Possible values:
- file-to-system: Sync from files to system (default)
- system-to-file: Sync from system to files
- bidirectional: Bidirectional synchronization
[default: file-to-system]
-o, --output <OUTPUT>
Output file for system-to-file sync
-p, --pattern <PATTERN>
File patterns to watch
--debounce <DEBOUNCE>
Debounce duration in milliseconds
[default: 300]
-l, --log <LOG>
Log changes to file
-v, --vars <VARS>
Variables to sync (sync all if not specified)
-q, --quiet
Quiet mode - less output
-h, --help
Print help (see a summary with '-h')
# Watch .env file and apply changes to system
envx watch .env
# Watch and sync system changes back to file
envx watch --direction system-to-file --output backup.env
# Bidirectional sync
envx watch --direction bidirectional .env
# Watch multiple files with patterns
envx watch --pattern "*.env" --pattern "config/*.yaml"
# Watch with custom settings
envx watch .env --debounce 500ms --log changes.log
monitor
- Monitor environment variable changes (read-only)Monitor environment variable changes (read-only)
Usage: envx.exe monitor [OPTIONS] [VARIABLE]...
Arguments:
[VARIABLE]...
Variables to monitor (monitor all if not specified)
Options:
-l, --log <LOG>
Log file path
--changes-only
Show only changes (hide unchanged variables)
-s, --source <SOURCE>
Filter by source
[possible values: system, user, process, shell]
-f, --format <FORMAT>
Output format
Possible values:
- live: Live terminal output
- compact: Compact output
- json-lines: JSON lines format
[default: live]
--interval <INTERVAL>
Check interval in seconds
[default: 2]
--show-initial
Show initial state
--export-report <EXPORT_REPORT>
Export report on exit
-h, --help
Print help (see a summary with '-h')
# Monitor all environment variables
envx monitor
# Monitor specific variables
envx monitor PATH JAVA_HOME NODE_ENV
# Show only changes (hide static vars)
envx monitor --changes-only
# Monitor with logging
envx monitor --log audit.log
# Monitor variables from specific source
envx monitor --source system
โ
/โ
or j
/k
- Navigate up/downPageUp
/PageDown
- Navigate by pageHome
/End
- Jump to first/last itemEnter
or v
- View variable details/
- Enter search modea
- Add new variablee
- Edit selected variabled
- Delete selected variabler
- Refresh listq
- QuitEsc
- Cancel searchEnter
- Apply searchTab
- Switch between name and value fieldsCtrl+Enter
- Save changesEsc
- Cancel editingenvx stores its configuration in platform-specific locations:
%APPDATA%\envx\config.toml
~/Library/Application Support/envx/config.toml
~/.config/envx/config.toml
[general]
default_export_format = "json"
auto_backup = true
history_limit = 100
[ui]
theme = "dark"
highlight_system_vars = true
envx is built with a modular architecture:
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)# Clone the repository
git clone https://github.com/yourusername/envx.git
cd envx
# Build the project
cargo build
# Run tests
cargo test
# Run with debug logging
RUST_LOG=debug cargo run -- tui
This project is licensed under the MIT License - see the LICENSE file for details.
envx is designed for performance:
Run with debug logging enabled:
RUST_LOG=debug envx list
Written with โค๏ธ in Rust & built with Ratatui