Crates.io | rsenv |
lib.rs | rsenv |
version | 0.14.6 |
source | src |
created_at | 2023-08-14 13:20:42.398869 |
updated_at | 2024-08-31 16:48:15.875016 |
description | Hierarchical environment variable management |
homepage | |
repository | https://github.com/sysid/rs-env |
max_upload_size | |
id | 944159 |
size | 144,590 |
Managing environment variables for different projects, stages, regsions, etc. is an anavoidable chore when working on many cloud projects.
Especially the challenge of Avoiding duplication and knowing where a particular value is coming from. Hierarchical variable management is my approach to tame the beast.
<name>.env
files..envrc
file.cargo install rs-env
The resulting set of environment variables is an amalgamation of all linked files.
<name>.env
and must be prefixed with export
command# rsenv: <name.env>
or via: rsenv link <root.env> <child1>.env <child2>.env
.Then source the resulting set of variables as usual:
source <(rsenv build <leaf-node.env>)
Hierarchical environment variable management
Usage: rsenv [OPTIONS] [NAME] [COMMAND]
Commands:
build Build the resulting set of environment variables (DAG/Tree)
envrc Write the resulting set of variables to .envrc (requires direnv, DAG/Tree)
files Show all files involved in resulting set (DAG/Tree)
edit-leaf Edit the given environment file and all its parents (DAG/Tree)
edit Edit the FZF selected branch/DAG
select-leaf select environment/branch and update .envrc file (requires direnv, DAG/Tree)
select FZF based selection of environment/branch and update of .envrc file (requires direnv, DAG/Tree)
link Link files into a linear dependency branch (root -> parent -> child)
branches Show all branches (linear representation)
tree Show all trees (hierarchical representation)
tree-edit Edit branches of all trees side-by-side (vim required in path)
leaves Output leaves as paths (Tree)
help Print this message or the help of the given subcommand(s)
Arguments:
[NAME] Optional name to operate on
Options:
-d, --debug... Turn debugging information on
--generate <GENERATOR> [possible values: bash, elvish, fish, powershell, zsh]
--info
-h, --help Print help
-V, --version Print version
direnv activates environments automatically.
rs-env can update the .envrc
file with the selected dependency graph variables.
Life injection of environment variables:
runenv.sh
as the "EnvFile" script (tick executable checkbox !).RUN_ENV
parametrizes which environment to load.<RUN_ENV>.env
in the specified directory.rsenv select
: run debug target and check rsenv .envrc file.