Skip to content

sysid/rs-env

Repository files navigation

rsenv logo

Hierarchical environment management with secure vault storage.

License: BSD-3-Clause Rust

Why?

  • You work on many projects, with different teams, many repos.
  • You need a personal workspace, which is attached to the project, but does not become part of its official repository (e.g. patched docker-compose.yml, bespoke Java test classes, etc.)
  • environment configurations are not DRY, they share variables, often follow even a hierarchy (globlal -> company -> region -> stage)

Solution:

  1. File/directory overrides: when work starts swap workspace data in, when finished replace with originals, keep your personal data separate (vault)
  2. Model environment variable configs as trees and keep it DRY

Benefit:

  • Personal project specific workspace (can have its own repo)
  • Minimal footprint in original project: one symlink to link the project and workspace (.envrc)

rsenv illustration

This is a complete rewrite of V1 with 100% functional compatibility and new features.

Features

  • Hierarchical env files - Link files with # rsenv: parent.env, children override parents
  • Vault storage - Move sensitive files outside your project, replaced by symlinks
  • File swapping - Swap files with personal versions for the duration of the work-session
  • SOPS encryption - Encrypt sensitive files in the vault with GPG or Age
  • Shell integration - Works seamlessly with [direnv9(https://direnv.net/)

See all features in the wiki

Quick Start

cargo install rsenv

rsenv init vault            # Create vault for project
rsenv guard add .env        # Move .env to vault, create symlink
rsenv env tree              # View environment hierarchy
rsenv env select            # Interactive environment selection

Full quick start guide

Commands

Command Purpose
init Initialize vault for project
env Manage environment hierarchy
guard Protect sensitive files
swap Toggle dev/prod configs
sops Encrypt/decrypt vault
config Manage settings
info Show project status

Full command reference

Documentation

Getting Started: Installation · Quick Start · Core Concepts

Features: Environment Variables · Vault Management · File Swapping · SOPS Encryption

Reference: Commands · Configuration · Troubleshooting · Migration Guide

License

BSD-3-Clause