mirror of
https://github.com/hanzoai/kms.git
synced 2026-10-17 11:18:16 +00:00
- Alias @infisical/quic → @hanzo/quic and @infisical/pg-view-generator → @hanzo/pg-view-generator in package.json using npm alias syntax (resolves same upstream packages) - Update gateway.ts and sanitized-schema.ts to import from @hanzo/* names - Rename helm-charts/kms-standalone/templates/infisical.yaml → deployment.yaml - Update Dockerfiles (backend, standalone, fips) with hanzo branding - Makefile: use 'docker compose' (v2) and docker-compose.prod.yml - Update docs to reference kms.hanzo.ai and hanzo tooling - .gitignore: add common dev artifacts
126 lines
2.7 KiB
Plaintext
126 lines
2.7 KiB
Plaintext
---
|
|
title: "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 KMS as environment variables in CI/CD pipelines and [Docker containers](/documentation/getting-started/docker)
|
|
|
|
Prerequisites:
|
|
|
|
- Have a project with secrets ready in [KMS Cloud](https://kms.hanzo.ai).
|
|
|
|
## Installation
|
|
|
|
Follow the instructions for your operating system to install the KMS CLI.
|
|
|
|
<Tabs>
|
|
<Tab title="MacOS">
|
|
Use [brew](https://brew.sh/) package manager
|
|
|
|
```console
|
|
$ brew install kms/get-cli/kms
|
|
```
|
|
</Tab>
|
|
<Tab title="Windows">
|
|
Use [Scoop](https://scoop.sh/) package manager
|
|
|
|
```console
|
|
$ scoop bucket add org https://github.com/KMS/scoop-kms.git
|
|
```
|
|
|
|
```console
|
|
$ scoop install kms
|
|
```
|
|
</Tab>
|
|
<Tab title="Alpine">
|
|
Install prerequisite
|
|
```console
|
|
$ apk add --no-cache bash sudo wget
|
|
```
|
|
|
|
Add KMS repository
|
|
```console
|
|
$ wget -qO- 'https://artifacts-cli.kms.hanzo.ai/setup.apk.sh' | sudo sh
|
|
```
|
|
|
|
Then install CLI
|
|
```console
|
|
$ apk update && sudo apk add kms
|
|
```
|
|
|
|
</Tab>
|
|
<Tab title="RedHat/CentOs/Amazon">
|
|
Add KMS repository
|
|
```console
|
|
$ curl -1sLf \
|
|
'https://artifacts-cli.kms.hanzo.ai/setup.rpm.sh' \
|
|
| sudo -E bash
|
|
```
|
|
|
|
Then install CLI
|
|
```console
|
|
$ sudo yum install kms
|
|
```
|
|
|
|
</Tab>
|
|
<Tab title="Debian/Ubuntu">
|
|
Add KMS repository
|
|
|
|
```console
|
|
$ curl -1sLf \
|
|
'https://artifacts-cli.kms.hanzo.ai/setup.deb.sh' \
|
|
| sudo -E bash
|
|
```
|
|
|
|
Then install CLI
|
|
```console
|
|
$ sudo apt-get update && sudo apt-get install -y kms
|
|
```
|
|
|
|
</Tab>
|
|
<Tab title="Arch Linux">
|
|
Use the `yay` package manager to install from the [Arch User Repository](https://aur.archlinux.org/packages/kms-bin)
|
|
|
|
```console
|
|
$ yay -S kms-bin
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
## Login
|
|
|
|
Authenticate the CLI with the KMS platform using your email and password.
|
|
|
|
```console
|
|
$ hanzo-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 KMS platform and creates a `kms.json` file containing a reference to that latter project.
|
|
|
|
```console
|
|
$ hanzo-kms init
|
|
```
|
|
|
|
## Start your app with environment variables injected
|
|
|
|
```console
|
|
$ hanzo-kms run -- <your_application_start_command>
|
|
```
|
|
|
|
## Example Start Commands
|
|
|
|
```console
|
|
$ hanzo-kms run -- npm run dev
|
|
$ hanzo-kms run -- flask run
|
|
$ hanzo-kms run -- ./your_bash_script.sh
|
|
```
|
|
|
|
Your app should now be running with the secrets from KMS injected as environment variables.
|
|
|
|
See also:
|
|
|
|
- [Full documentation for the KMS CLI](/cli/overview) |