CLI
The KMS CLI can be used to inject secrets into any framework like Next.js, Express, Django and more in local development.
It can also be used to expose secrets from Hanzo KMS as environment variables in CI/CD pipelines and Docker containers
Prerequisites:
- Have a project with secrets ready in Hanzo KMS Cloud.
Installation
Follow the instructions for your operating system to install the KMS CLI.
Use brew package manager
$ brew install kms/get-cli/kmsUse Scoop package manager
$ scoop bucket add org https://github.com/hanzoai/kms/scoop-kms.git$ scoop install kmsInstall prerequisite
$ apk add --no-cache bash sudo wgetAdd Hanzo KMS repository
$ wget -qO- 'https://artifacts-cli.kms.hanzo.ai/setup.apk.sh' | sudo shThen install CLI
$ apk update && sudo apk add kmsAdd Hanzo KMS repository
$ curl -1sLf \
'https://artifacts-cli.kms.hanzo.ai/setup.rpm.sh' \
| sudo -E bashThen install CLI
$ sudo yum install kmsAdd Hanzo KMS repository
$ curl -1sLf \
'https://artifacts-cli.kms.hanzo.ai/setup.deb.sh' \
| sudo -E bashThen install CLI
$ sudo apt-get update && sudo apt-get install -y kmsUse the yay package manager to install from the Arch User Repository
$ yay -S kms-binLogin
Authenticate the CLI with the Hanzo KMS platform using your email and password.
$ kms loginInitialization
Navigate to the root of your project directory and run the init command. This step connects your local project to the project on the Hanzo KMS platform and creates a kms.json file containing a reference to that latter project.
$ kms initStart your app with environment variables injected
$ kms run -- <your_application_start_command>Example Start Commands
$ kms run -- npm run dev
$ kms run -- flask run
$ kms run -- ./your_bash_script.shYour app should now be running with the secrets from Hanzo KMS injected as environment variables.
See also:
How is this guide?
Last updated on