npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kvault

v0.2.0

Published

CLI for HashiCorp Vault Key/Value V2 secret engines

Downloads

9

Readme

Vault CLI (kvault)

CI npm install size license

kvault is a CLI for managing HashiCorp Vault Key/Value V2 secret engines from the command line.


📦 Installation

npx kvault --help # Or bunx kvault --help
Make it global
npm install --global kvault

📖 Usage

Usage: kvault [options] [command]

Manage your HashiCorp Vault Key/Value v2 secret engines from the command line.

Author: Shahrad Elahi <[email protected]> (https://github.com/shahradelahi)
License: GPL-3.0

Options:
  -v, --version                               display the version number
  -h, --help                                  display help for command

Commands:
  make-profile [options] <name>               Create a new vault profile
  mount [options] <mount-path>                Mount a new KV2 secret engine
  pipe [options] <secrets-path> [command...]  Pull an environment from Vault and pipe it to a command
  push [options] <env-file> <secrets-path>    Push an environment to Vault
  pull [options] <secrets-path>               Pull an environment from Vault
  rm [options] <secrets-path> [versions...]   Remove a secret from Vault
  seal [options]                              Seal Vault
  unmount [options] <mount-path>              Unmount a secret engine
  unseal [options] [keys...]                  Unseal Vault
  help [command]                              display help for command

make-profile

This command will create a profile in your home directory. It will be used to store your Vault's address and token.

Options

Usage: kvault make-profile [options] <name>

Create a new vault profile

Options:
  --endpoint-url <endpoint-url>  Vault endpoint URL
  --token <vault-token>          Vault token
  --force                        Overwrite existing profile (default: false)
  -h, --help                     display help for command
Examples
# Create a new profile
kvault make-profile my-profile --endpoint-url https://vault.example.com --token my-token

push

This command will push a secret to your Vault.

Options

Usage: kvault push [options] <env-file> <secrets-path>

Push an environment to Vault

Options:
  -P, --profile <name>           Name of the profile to use.
  --endpoint-url <endpoint-url>  Vault endpoint URL
  --token <vault-token>          Vault token
  --cwd <cwd>                    Current working directory (default: ".")
  --force                        Write to Vault even if the secrets are in conflict (default: false)
  -h, --help                     display help for command
Examples
# Push a .env.local file to Vault
kvault push --profile my-profile .env.local secret/my-app

# Use credentials instead of a profile
kvault push --endpoint-url https://vault.example.com --token my-token .env.local secret/my-app

pull

This command will pull a secret from your Vault.

Options

Usage: kvault pull [options] <secrets-path>

Pull an environment from Vault

Options:
  -P, --profile <name>             Name of the profile to use.
  --endpoint-url <endpoint-url>    Vault endpoint URL
  --token <vault-token>            Vault token
  -O, --output-file <output-path>  Path to write the environment file to
  -F, --format <format>            Format of the environment file (default: "dotenv")
  --cwd <cwd>                      Current working directory (default: ".")
  --force                          Write environment file even if it exists (default: false)
  -h, --help                       display help for command
Examples
# Pull a secret from Vault
kvault pull --profile my-profile secret/my-app

# Pull a secret from Vault and save it to a .env file
kvault pull --profile my-profile secret/my-app --env-path .env

# Pull a secret from Vault and add them to shell environment
kvault pull --profile my-profile secret/my-app --format shell | grep -e '^export' | source /dev/stdin

pipe

This command will pull and pipe secrets from your Vault to another command.

Options

Usage: kvault pipe [options] <secrets-path> [command...]

Pull an environment from Vault and pipe it to a command

Arguments:
  secrets-path
  command                        Command to pipe to (default: [])

Options:
  -P, --profile <name>           Name of the profile to use.
  --endpoint-url <endpoint-url>  Vault endpoint URL
  --token <vault-token>          Vault token
  --cwd <cwd>                    Current working directory (default: ".")
  -h, --help                     display help for command
Examples
# Pull a secret from Vault and pipe it to a command
kvault pipe --profile my-profile secret/my-app env | grep -e '^MY_APP_'

# Pull a secret from Vault and pipe it to a node script
kvault pipe --profile my-profile secret/my-app "node -e 'console.log(process.env.MY_APP_SECRET)'"

rm

This command will remove a path or some versions of a secret.

Options

Usage: kvault rm [options] <secrets-path> [versions...]

Remove a secret from Vault

Arguments:
  secrets-path
  versions                       Versions to remove. By default, path will be removed. (default: [])

Options:
  -P, --profile <name>           Name of the profile to use
  --endpoint-url <endpoint-url>  Vault endpoint URL
  --token <vault-token>          Vault token
  --force                        Remove the secret without confirmation (default: false)
  -h, --help                     display help for command
Examples
# Remove a path secret from Vault
kvault rm --profile my-profile secret/my-app

# Remove a secret version from Vault
kvault rm --profile my-profile secret/my-app 3 4

🤝 Contributing

Want to contribute? Awesome! To show your support is to star the project, or to raise issues on GitHub.

Thanks again for your support, it is much appreciated!

License

GPL-3.0 © Shahrad Elahi