envchain Documentation

repository·master·Indexed 23 days ago

https://github.com/sorah/envchain

A tool for securely managing environment variables by storing them in system vaults such as macOS Keychain or D-Bus Secret Service instead of plain text files. It allows users to organize variables into namespaces, execute commands with specific namespaces loaded, and list stored namespaces via a CLI.

Tokens
556
Snippets
5
Records
6
Agent score
30%

What's inside envchain

  1. System Requirements

    master

    macOS

    • Confirmed on OS X 10.11 (El Capitan) and 10.12 (Sierra).
    • OS X 10.7 (Lion) or later is required (unconfirmed).

    Linux

    Requires the following:

    • readline
    • libsecret
    • A D-Bus Secret Service (e.g., GNOME keyring or KeePassXC).
  2. Save environment variables to a namespace

    master

    Use the --set flag to securely store environment variables in your system's vault (macOS Keychain or D-Bus Secret Service). Variables are organized into a NAMESPACE. When saving, you will be prompted to enter the value for each variable provided.

    Variables are stored as application passwords with the prefix envchain-NAMESPACE.

    envchain --set NAMESPACE ENV [ENV ..]
  3. Execute commands with defined variables

    master

    To run a command with the environment variables from a specific namespace loaded, use envchain <NAMESPACE> <COMMAND>.

    You can also load multiple namespaces simultaneously by separating them with commas.

    Examples

    Run a single namespace:

    envchain aws s3cmd blah blah blah

    Load multiple namespaces:

    envchain aws,hubot env
    envchain aws,hubot env
  4. Reference: envchain CLI flags

    master

    Available flags for envchain:

    • --set NAMESPACE ENV [ENV ..]: Prompt for and save variables within a namespace.
    • --list: List all created namespaces.
    • --noecho: Do not echo user input when prompted for variable values during --set.
    • --require-passphrase: Always ask for the keychain passphrase during --set.
    • --no-require-passphrase: Do not ask for the keychain passphrase during --set.
    envchain --set NAMESPACE ENV [ENV ..]
    envchain --list
    envchain --set --noecho foo BAR
    envchain --set --require-passphrase name
    envchain --set --no-require-passphrase name