Skip to main content
The Command Line Interface (CLI) is a tool that allows you to create JWTs for testing and development on the command line. This guide will cover how to install, configure, and use the CLI.

Prerequisites

Before you use the CLI, you will need:
  • An account and instance.
  • A private key to authenticate with the API. You can generate one in the Integrations section of your dashboard.

Installation

Our CLI required Node JS to be installed. Once you’re ready, run the following command to install the CLI globally.

Configuration

Once the CLI is installed, you need to configure it with your Gr4vy credentials. This command will securely store your gr4vy-id and private key for future use.
  1. Run the configuration command:
  2. The CLI will require you to pass the following information:
    • gr4vyId: mattilda.
    • environment: Your environment (e.g., sandbox or production).
    • privateKey: The path to the private key that you generated and downloaded locally.
Your credentials will be stored in a configuration file, typically located at ~/.gr4vyrc.json.

General usage

Next, you can create a JWT for use in Embed as well as for server-to-server use.
Additionally, you can inspect each token by passing the --debug flag.
More details on each command is available below.

Commands

gr4vy autocomplete

Provides installation instructions to help you enable auto-complete for the CLI.

gr4vy checkout-session

Generate a checkout session ID.

gr4vy embed

Generate a token for use with Gr4vy Embed.

gr4vy help

Display help for the gr4vy command.

gr4vy init

Generates a configuration file that can be used to generate the token.

gr4vy token

Generate a bearer token for server-to-server API calls.