cli

_get_parser

msdss_base_dotenv.cli._get_parser()[source]

Builds an argparse parser for the msdss-dotenv command line tool.

Returns

An argparse parser for msdss-dotenv.

Return type

argparse.ArgumentParser

Author

Richard Wen <rrwen.dev@gmail.com>

Example

from msdss_base_dotenv.cli import _get_parser

parser = _get_parser()
parser.print_help()

run

msdss_base_dotenv.cli.run()[source]

Runs the msdss-dotenv command.

Author

Richard Wen <rrwen.dev@gmail.com>

Example

>>> msdss-dotenv --help
usage: ipykernel_launcher.py [-h] [--env_file ENV_FILE] [--key_path KEY_PATH]
                             {init,set,del,clear} ...

Manages encrypted .env files

optional arguments:
  -h, --help            show this help message and exit
  --env_file ENV_FILE   path of .env file
  --key_path KEY_PATH   path of key file

commands:
  {init,set,del,clear}
    init                create env file and key
    set                 set an env var
    del                 delete an env var
    clear               clear env file and key

Initialize env and key files (run this first):

>>> msdss-dotenv init

Set USER var to msdss:

>>> msdss-dotenv set USER msdss

Remove USER var:

>>> msdss-dotenv del USER

Clear env and key files:

>>> msdss-dotenv clear