Skip to main content
The Gr4vy CLI is a single, self-contained binary for working with Gr4vy from your terminal. It can:
  • generate access tokens and Embed tokens for development and testing,
  • manage multiple instances and credentials as named profiles, and
  • call every Gr4vy API operation — buyers, transactions, payment methods, checkout sessions, reports, and more.
It is built on the official Go SDK, and its command surface is generated from the SDK, so it stays in sync with the API automatically.
The previous npm package @gr4vy/cli is deprecated. The CLI is now distributed as a native binary — install it with one of the options below instead of npm.

Prerequisites

  • An account and instance (your instance ID, for example acme).
  • Credentials, either:
    • a private key to sign API tokens — generate one in the Integrations section of the dashboard and download it as a .pem file, or
    • your dashboard email and password, for user login.

Installation

Prebuilt archives for every platform are also available on the releases page. Verify your install with:

Configuration

The CLI stores connection settings as named profiles in ~/.config/gr4vy/config.toml, so you can switch between instances and environments. Private keys and login sessions are kept in your operating system keychain (with a 0600 file fallback on headless systems) — never in the config file.
1

Create a profile

Run gr4vy init for an interactive setup, or create one directly:
2

Verify it

Working with multiple instances

Every setting can also come from an environment variable (handy for CI), with the precedence flag > environment variable > active profile > default:

Authentication

Each profile uses one of two methods:
  • Key (default) — your merchant private key signs a short-lived token for every request.
  • Login — exchange your dashboard email and password for a session that the CLI refreshes automatically:

Generating tokens

Add --debug to any token command to also print the decoded JWT header and claims:

Calling the API

Every SDK operation is available as gr4vy <resource> <action>. Path parameters are positional arguments; request bodies are passed with --data (inline JSON, @file.json, or - for stdin); filters and query parameters are flags.
Explore the tree interactively with --help at any level:
The full, per-command reference lives in the CLI repository.

Output formats

Use -o, --output to choose the format — it defaults to a table on a terminal and JSON when piped:
List commands accept --limit and --cursor; the response includes a next_cursor for paging. --compact emits single-line JSON.

Shell completion

Completion is built in for bash, zsh, fish, and PowerShell. Load it in your current shell to try it:
To install it permanently, run gr4vy completion <shell> --help for the exact steps for your shell. Flags with fixed choices (such as token --scope) complete their values.