Centrally manage environment variables with SQLite
- Automatically export/unexport environments when entering/leaving directories
- Keep a global view of which variables apply to which projects (as well as date created/updated, optional comments).
- Filter environments to keep your view manageable:
enventory env list --expr 'filter(Envs, hasPrefix(.Name, "test") and .UpdateTime > now() - duration("90d"))'- Share variables between environments with variable references
- Advanced tab completion! Autocomplete commands, flags, env names, var/ref names
- Currently only supports
zsh
I'm using enventory personally and I quite enjoy using it! That said, I work
on enventory for fun/learning, which means changing API and CLI structure as
I feel like it (I feel pretty good about the current structure though).
I do my best to test changes to the codebase (I've actually got a pretty neat
snapshot test system), and I've never lost data, but I'm only human, so back up
sensitive API keys in a password safe (I really like
KeePassXC) instead of storing them soley in
envetory
scoop bucket add bbkane https://github.com/bbkane/scoop-bucket
scoop install bbkane/enventory
- Download Mac/Linux/Windows executable: GitHub releases
- Go:
go install go.bbkane.com/enventory@latest - Build with goreleaser after cloning:
goreleaser release --snapshot --clean
zshis currently the only shell supported
eval "$(enventory shell zsh init)"This also provides functions export-env and unexport-env to easily export environments into the current shell session:
export-env my-environmentenventory is quite a verbose CLI, so tab completion (which also
auto-completes env names, var names, and var ref names) is super useful (to the
point where I wouldn't want to use enventory without it). Homebrew does this
automatically.
enventory completion zsh > /something/in/$fpathTurns out there are a lot of options in this space! Here are some of my favorites:
direnv- uses.envrcfiles in directories to export variablesdotenv- a family of tools to store env vars in config files in directories. Optional encryptionenvchain- Save environment variables in the OS keychainenvelope- another approach to using SQLite to store environment variables. Side note: I had originally namedenventoryenvelope. I changed the name once I noticed this project.mise- manages tool versions, environments, and tasks through config files in directories
See Go Project Notes for notes on development tooling and CI/CD setup (including demo gif generation)
Install:
brew install k1LoW/tap/tblsRun:
# get a fresh db
go run . env list --db-path tmp.db
tbls doc --rm-distGenerate ./sqlite/sqlite/sqlcgen
go generate ./...Debug enventory with OTEL tracing:
MOTEL_TRACES_EXPORTER=stdout go run . env showSee the motel repo for other ways to visualize OTEL traces
