Rivergate

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.

Commands

CommandWhat it does
rivergate auth login --url URLSave a token read from standard input.
rivergate auth statusShow whether you are signed in and to which URL.
rivergate auth logoutRemove the local token copy.
rivergate org listList your organizations.
rivergate project list ORG_IDList projects.
rivergate environment list ORG_ID PROJECT_IDList environments.
rivergate secret list ORG_ID PROJECT_ID ENVIRONMENT_IDList secret metadata. No values.
rivergate secret get ORG_ID PROJECT_ID ENVIRONMENT_ID SECRET_IDRead the current value. Explicit and audited.
rivergate request [--body-file FILE] METHOD PATHCall 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
The value is written to standard output in plaintext

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

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.