Use environments from code, CI and servers

Machine tokens, the aman CLI and SDKs for Node, Python, Go, Java/Kotlin, PHP, .NET and Rust — decrypted on your side.

Web
On this page
  1. Create a token
  2. The CLI
  3. SDKs
  4. CI and Kubernetes

Programs read an environment with a machine token. Decryption happens on the machine that runs the program: Woosool never sees the values.

Create a token

Secrets → project → environment → Machine tokens: name it, choose an expiry and, optionally, the IP addresses or ranges it may be used from. Copy the wsv_… token — it is shown once — into your CI secret store or server configuration as AMAN_TOKEN, with AMAN_URL set to your Aman address.

A token is read-only and limited to one environment. It stops working when it expires or is revoked, when the environment key is rotated, and when the person who created it loses access (an admin can Re-issue it). Its creator can also re-issue it to rotate the secret.

The CLI

curl -fsSL https://aman.woosool.com/aman.mjs -o aman.mjs      # Node 18 or later
node aman.mjs run -- npm start                               # variables only inside the program
node aman.mjs pull --format dotenv --out .env                # or json, yaml, shell, docker, k8s
node aman.mjs login --env prod                               # keep one token per environment

pull won't print secrets on the screen without --reveal, and asks for --force before writing a protected environment, or a file Git would commit.

SDKs

Node / TypeScript, Python, Go, Java / Kotlin, PHP, .NET and Rust share the same simple use: create the client (it reads AMAN_URL / AMAN_TOKEN), then get("DATABASE_URL"), read everything, or inject the variables into the process. They cache for a minute, retry network errors and never log values.

CI and Kubernetes

Keep the token in the CI's secret store and wrap the deploy command with aman run --. In Kubernetes only the token is a Kubernetes Secret: run the app through aman run --, or let an init container write the variables to an in-memory volume.

Warning

A token is a password for machines. Never commit it; give each pipeline its own token, with an IP allowlist where you can.