Command line
A small, scriptable client for the public API. It stores nothing but a token, and never connects to your database.
Install
The CLI is a Go module in its own repository and uses the sibling rivergate-sdk-go checkout. Clone both side by side, then build.
git clone https://github.com/rivergate-dev/rivergate-sdk-go.git
git clone https://github.com/rivergate-dev/rivergate-cli.git
make -C rivergate-cli build
# binary: rivergate-cli/bin/rivergate
Sign in
The CLI authenticates with a personal API token. Pipe it in so it is never echoed or stored in shell history:
pbpaste | rivergate auth login --url https://rivergate.example.com
rivergate auth status
On Linux, pipe from the clipboard utility you use, or supply the token through RIVERGATE_TOKEN in a protected process environment.
- The token is saved in your OS user config directory as
rivergate/config.json, with owner-only permissions on supported filesystems. - That file holds a bearer credential in plaintext. Do not sync it to shared storage or include it in backups you do not control.
RIVERGATE_URLandRIVERGATE_TOKENoverride saved values.- Use HTTPS for deployed instances.
Commands
| Command | What it does |
|---|---|
rivergate auth login --url URL | Save a token read from standard input. |
rivergate auth status | Show whether you are signed in and to which URL. |
rivergate auth logout | Remove the local token copy. |
rivergate org list | List your organizations. |
rivergate project list ORG_ID | List projects. |
rivergate environment list ORG_ID PROJECT_ID | List environments. |
rivergate secret list ORG_ID PROJECT_ID ENVIRONMENT_ID | List secret metadata. No values. |
rivergate secret get ORG_ID PROJECT_ID ENVIRONMENT_ID SECRET_ID | Read the current value. Explicit and audited. |
rivergate request [--body-file FILE] METHOD PATH | Call any public API route and print the JSON response. |
Identifiers are scoped: a project belongs to an organization and an environment to a project. The CLI only returns what your policies allow.
Reading a secret
rivergate secret get ORG_ID PROJECT_ID ENVIRONMENT_ID SECRET_ID
Avoid terminal recording, shell tracing and command substitution that persists the result. Pipe it directly into the process that needs it.
Calling any route
For operations without a dedicated subcommand — creating or updating secrets, rollback, policies and more — use request. It accepts GET, POST, PUT and DELETE. Send request bodies through standard input so values never appear in process arguments:
cat secret-request.json | rivergate request --body-file - POST \
/api/v1/organizations/ORG_ID/projects/PROJECT_ID/environments/ENVIRONMENT_ID/secrets
- The maximum request body is 6 MiB.
- Body files contain plaintext. Create them owner-only and remove them after use.
- Treat any output from an explicit value read as sensitive.
Signing out and revoking
auth logout only removes your local copy. It does not revoke the token on the server. If a token should stop working, revoke it through the token API.
Using it in scripts
export RIVERGATE_URL=https://rivergate.example.com
export RIVERGATE_TOKEN="$(cat /run/secrets/rivergate-token)"
# Inject a value into a single process without writing it to disk
DATABASE_PASSWORD="$(rivergate secret get ORG_ID PROJECT_ID ENVIRONMENT_ID SECRET_ID)" ./run-migration
Prefer short-lived tokens in automation and give the owning user only the policies the job needs. For workloads on Kubernetes, use the Operator instead of embedding a user token.