-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
sysid edited this page Jan 11, 2026
·
3 revisions
Get productive in 5 minutes.
- direnv installed and hooked into your shell
- A project directory you want to manage
# Via Cargo (Rust)
cargo install rsenv
# Verify installation
rsenv --versionFor detailed installation instructions, see Installation.
# Navigate to your project
cd ~/myproject
# Initialize a vault
rsenv init vault
# Check what happened
rsenv infoWhat just happened:
- Created vault at
~/.rsenv/vaults/myproject-{id}/ - Moved
.envrcto vault asdot.envrc(or created empty one) - Created symlink:
.envrc→ vault'sdot.envrc - Set up
RSENV_VAULTenvironment variable
# Create a base environment (shared settings)
cat > $RSENV_VAULT/envs/base.env << 'EOF'
export DATABASE_PORT=5432
export LOG_FORMAT=json
export TIMEOUT=30
EOF
# Make local.env inherit from base
cat > $RSENV_VAULT/envs/local.env << 'EOF'
# rsenv: base.env
export RUN_ENV="local"
export DATABASE_HOST=localhost
export LOG_LEVEL=debug
EOF
# Build and see the merged result
rsenv env build $RSENV_VAULT/envs/local.envExpected output:
export DATABASE_PORT=5432 # from base.env
export LOG_FORMAT=json # from base.env
export TIMEOUT=30 # from base.env
export RUN_ENV="local" # from local.env
export DATABASE_HOST=localhost
export LOG_LEVEL=debug# Create a sensitive file
mkdir -p config
echo 'api_key: "sk-secret-123"' > config/secrets.yaml
# Guard it (move to vault, create symlink)
rsenv guard add config/secrets.yaml
# Verify
ls -la config/secrets.yaml
# config/secrets.yaml -> ~/.rsenv/vaults/.../guarded/config/secrets.yamlResult: config/secrets.yaml is now a symlink. The actual file lives safely in your vault, outside git.
# Interactively select an environment (uses fuzzy finder)
rsenv env select
# View hierarchy as tree
rsenv env tree# Build and source in one command
source <(rsenv env build $RSENV_VAULT/envs/local.env)
# Verify
echo $DATABASE_HOST # localhost# Edit dot.envrc to load different env file
# Change: dotenv $RSENV_VAULT/envs/local.env
# To: dotenv $RSENV_VAULT/envs/prod.env
# Reload with direnv
direnv allow# First, configure GPG key
rsenv config init --global
# Edit ~/.config/rsenv/rsenv.toml, set sops.gpg_key
# Encrypt all matching files
rsenv sops encrypt
# Check status
rsenv sops statusIf you need to undo initialization:
# Restore all guarded files, remove .envrc symlink
rsenv init reset
# Note: Vault directory is NOT deleted (manual cleanup required)# Show project and vault status
rsenv info
# Show effective configuration
rsenv config show
# List guarded files
rsenv guard list
# Edit environment files (fuzzy select)
rsenv env edit
# View environment hierarchy
rsenv env treeNow that you've got the basics:
- Core Concepts - Understand the vault philosophy
- Environment Variables - Master hierarchical environments
- Vault Management - Guard more files, manage your vault
- SOPS Encryption - Encrypt vault contents
- Configuration - Customize rsenv settings
direnv not loading .envrc:
direnv allow"Vault not initialized" error:
rsenv init vaultWrong environment loaded:
# Check what's configured
rsenv info
# Verify symlink
ls -la .envrcFor more troubleshooting, see Troubleshooting.
rsenv Documentation