Env-Alias is a helper utility to create shell alias commands that easily set collections of environment variables often with secret values from a variety of data-sources and data-formats.

Typically this tool is invoked via an entry in .bash_aliases with an entry in the form

eval $(env-alias my-alias-name ~/path-to/my-alias-name-config-file.yml)

Where this example would establish a shell alias command for the alias my-alias-name that then invokes the env-alias-generator with configuration from ~/path-to/my-alias-name-config-file.yml

This provides an appropriate mechanism to manage large sets of environment variables with values from encrypted or otherwise secured data-sources through one simple alias command using a configuration file that can be safely committed to source control without exposing secret values.

Features

  • Data sources: direct-setting, exec-stdout, local-file, http-remote
  • Source file formats: text, ini, json, yaml
  • Select using line-numbers, jq-style or xpath-style selections
  • Reference other env values within configuration
  • Content-Type detection for http-remote data-sources to automatically assign appropriate parser
  • Exec helper commands without env-variable assignment
  • Debug mode output to STDERR

Install

pip3 install env-alias

Project