Skip to content

Commit

Permalink
fix vault script name in help and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Esgrove committed Oct 30, 2024
1 parent 86bde53 commit 7ab731f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 36 deletions.
69 changes: 34 additions & 35 deletions python-pyo3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,44 @@ See the [root readme](../README.md) for more general information.

## Usage

Uses `pvault` command name to avoid conflict with the previous Python version and the Rust version.

```console
Usage: pvault [OPTIONS] COMMAND [ARGS]...

Nitor Vault CLI, see https://github.com/nitorcreations/vault for usage examples

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --bucket -b TEXT Override the bucket name [env var: VAULT_BUCKET] │
│ --key-arn -k TEXT Override the KMS key ARN [env var: VAULT_KEY] │
│ --prefix -p TEXT Optional prefix for key name [env var: VAULT_PREFIX] │
│ --region -r TEXT Specify AWS region for the bucket [env var: AWS_REGION] │
│ --vault-stack TEXT Specify CloudFormation stack name to use [env var: VAULT_STACK] │
│ --quiet -q Suppress additional output and error messages │
│ --version -v Print version and exit │
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it or customize the installation. │
│ --help -h Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ all | a | list | ls List available secrets │
│ decrypt | y Directly decrypt given value │
│ delete | d Delete an existing key from the store │
│ describe Print CloudFormation stack parameters for current configuration │
│ encrypt | e Directly encrypt given value │
│ exists Check if a key exists │
│ id Print AWS user account information │
│ info Print vault information │
│ init | i Initialize a new KMS key and S3 bucket │
│ lookup | l Output secret value for given key │
│ status Print vault stack information │
│ store | s Store a new key-value pair │
│ update | u Update the vault CloudFormation stack │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Encrypted AWS key-value storage utility

Usage: vault [OPTIONS] [COMMAND]

Commands:
all, -a, --all List available secrets [aliases: a, list, ls]
completion, --completion Generate shell completion
delete, -d, --delete Delete an existing key from the store
describe, --describe Print CloudFormation stack parameters for current configuration
decrypt, -y, --decrypt Directly decrypt given value
encrypt, -e, --encrypt Directly encrypt given value
exists, --exists Check if a key exists
info, --info Print vault information
id, --id Print AWS user account information
status, --status Print vault stack information
init, -i, --init Initialize a new KMS key and S3 bucket
update, -u, --update Update the vault CloudFormation stack
lookup, -l, --lookup Output secret value for given key
store, -s, --store Store a new key-value pair
help Print this message or the help of the given subcommand(s)

Options:
-b, --bucket <BUCKET> Override the bucket name [env: VAULT_BUCKET=]
-k, --key-arn <ARN> Override the KMS key ARN [env: VAULT_KEY=]
-p, --prefix <PREFIX> Optional prefix for key name [env: VAULT_PREFIX=]
-r, --region <REGION> Specify AWS region for the bucket [env: AWS_REGION=]
--vault-stack <NAME> Specify CloudFormation stack name to use [env: VAULT_STACK=]
-q, --quiet Suppress additional output and error messages
-h, --help Print help (see more with '--help')
-V, --version Print version
```

## Install

Install command globally using pip. From repo root:
Build and install command globally using pip.
This requires a [Rust toolchain](https://rustup.rs/) to be able to build the Rust library.
From repo root:

```shell
cd python-pyo3
Expand All @@ -56,7 +55,7 @@ If you ran the install command inside a virtual env,
it will only be installed to the venv.

```shell
which -a pvault
which -a vault
```

## Development
Expand Down
2 changes: 1 addition & 1 deletion python-pyo3/python/p_vault/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
def main():
try:
# Override the script name in the arguments list so the Rust CLI works correctly
args = ["pvault"] + sys.argv[1:]
args = ["vault"] + sys.argv[1:]
nitor_vault_rs.run(args)
except KeyboardInterrupt:
print("\naborted")
Expand Down

0 comments on commit 7ab731f

Please sign in to comment.