Giter Site home page Giter Site logo

tddschn / envchain-shellenv Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 121 KB

envchain-shellenv - prints export statements for your secrets in the keychain

Home Page: https://pypi.org/project/envchain-shellenv

License: MIT License

Makefile 4.47% Python 95.53%
environment-variables keychain keyring secrets shell envchain

envchain-shellenv's Introduction

envchain shellenv

Injecting secrets from envchain / keychain into your shell as environment variables, in batch.

envchain-shellenv - prints export statements for your secrets in the keychain

so that you can do eval "$(envchain-shellenv)".

Use with envchain for maximum convenience.

Quick Start

# install envchain first, and add your secrets to your keychain app via envchain
# for macOS with Homebrew, run `brew install envchain'.
# see https://github.com/sorah/envchain for more details.

# install envchain-shellenv
pipx install envchain-shellenv || pip install envchain-shellenv

# creates an example config at ~/.config/envchain-shellenv/keychain.ini
envchain-shellenv --create-example-config
# edit config file with your favorite editor
vim ~/.config/envchain-shellenv/keychain.ini

# export your envchain secrets in the current shell
eval "$(envchain-shellenv)"
# optionally add this line to your shell startup file

Installation

Prerequisites

  • Required:
  • Optional:
    • keyring

      keyring is installed by default if you install envchain-shellenv with pipx.

      To use keyring when installing with pip, do pip install 'envchain-shellenv[keyring]'.

pipx

This is the recommended installation method.

$ pipx install envchain-shellenv
$ pip install envchain-shellenv

Usage:

envchain-shellenv prints export statements for your secrets in the keychain,

when you need your secrets in your shell env, just do eval "$(envchain-shellenv)".

$ eesh -h # `eesh' is just an alias for `envchain-shellenv', you can use either.

usage: envchain-shellenv [-h] [-c CONFIG] [--create-example-config] [-u {envchain,keyring}] [--version]

envchain shellenv - prints export statements for your secrets in the keychain

options:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        config file (default: /Users/tscp/.config/envchain-shellenv/keychain.ini)
  --create-example-config
                        create example config file (default: False)
  -u {envchain,keyring}, --use {envchain,keyring}
                        What to use to extract secrets (default: envchain)
  --version, -V         show program's version number and exit

Created by Teddy Xinyuan Chen || Homepage: https://github.com/tddschn/envchain-shellenv

Example

Example config file

test:
  TEST: TEST_SEC
  MULTILINE:
aws: # the envchain namespace
  AWS_SECRET_KEY:
  AWS_ROOT_PW: envchain-aws-root-pw
  # sets AWS_ROOT_PW env var to envchain-aws-root-pw in the aws namespace of envchain
no-item:
  # this will be skipped

Develop

$ git clone https://github.com/tddschn/envchain-shellenv.git
$ cd envchain-shellenv
$ poetry install

envchain-shellenv's People

Contributors

tddschn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.