Hanzo
PlatformHanzo KMSGetting Started

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:

Installation

Follow the instructions for your operating system to install the KMS CLI.

Use brew package manager

$ brew install kms/get-cli/kms

Use Scoop package manager

$ scoop bucket add org https://github.com/hanzoai/kms/scoop-kms.git
$ scoop install kms

Install prerequisite

$ apk add --no-cache bash sudo wget

Add Hanzo KMS repository

$ wget -qO- 'https://artifacts-cli.kms.hanzo.ai/setup.apk.sh' | sudo sh

Then install CLI

$ apk update && sudo apk add kms

Add Hanzo KMS repository

$ curl -1sLf \
'https://artifacts-cli.kms.hanzo.ai/setup.rpm.sh' \
| sudo -E bash

Then install CLI

$ sudo yum install kms

Add Hanzo KMS repository

$ curl -1sLf \
'https://artifacts-cli.kms.hanzo.ai/setup.deb.sh' \
| sudo -E bash

Then install CLI

$ sudo apt-get update && sudo apt-get install -y kms

Use the yay package manager to install from the Arch User Repository

$ yay -S kms-bin

Login

Authenticate the CLI with the Hanzo KMS platform using your email and password.

$ kms login

Initialization

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 init

Start 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.sh

Your app should now be running with the secrets from Hanzo KMS injected as environment variables.

See also:

How is this guide?

Last updated on

On this page