Skip to content
Platform Status

Technical Reference

CLI overview

The gram CLI manages platform resources directly from the terminal. Use it to authenticate, stage OpenAPI documents and Gram Functions for deployment, push and monitor deployments, install toolsets as MCP servers in AI agents, and keep the CLI itself up to date.

Install the gram CLI with one of the following methods:

curl -fsSL https://go.getgram.ai/cli.sh | bash

After installation, run the following command to verify that the CLI is installed correctly:

Terminal window
gram --version

Then authenticate:

Terminal window
gram auth

Use gram auth to bootstrap an account:

Terminal window
gram auth

Then, inspect the current profile:

Terminal window
gram whoami

The first time gram auth runs, it creates and saves a producer-scoped API key in the dashboard.

The following global options are available across CLI commands.

Use api-key to provide an API key (which must have the producer scope):

Terminal window
gram push --api-key MY_API_KEY [command options]

When this option is not provided, the CLI falls back to using the following values, in this order:

  • The GRAM_API_KEY environment variable
  • The secret field of the current profile in ~/.gram/profile.json

Use project to provide the target project’s slug:

Terminal window
gram push --project my-project [command options]

When this option is not provided, the CLI falls back to using the following values, in this order:

  • The GRAM_PROJECT environment variable
  • The defaultProjectSlug field of the current profile in ~/.gram/profile.json

Use org to provide the target organization’s slug:

Terminal window
gram push --org my-org [command options]

When this option is not provided, the CLI falls back to using the following values, in this order:

  • The GRAM_ORG environment variable
  • The organization of the current profile in ~/.gram/profile.json

Use log-level to set the base log level (the default is info). Because this is an app-level option, place it before the command name:

Terminal window
gram --log-level debug [command] [command options]

The base log level can also be set via the GRAM_LOG_LEVEL environment variable.

Use log-pretty to toggle pretty logging off. (By default, this option is set to true.) Because this is an app-level option, place it before the command name:

Terminal window
gram --log-pretty=false [command] [command options]

Pretty logging can also be toggled via the GRAM_LOG_PRETTY environment variable.

Use profile to provide the profile name to use from ~/.gram/profile.json. Because this is an app-level option, place it before the command name:

Terminal window
gram --profile production [command] [command options]

The profile name can also be set via the GRAM_PROFILE environment variable.

Use help to view the help information for any command:

Terminal window
gram [command] --help

Short form: -h

Use version to print the version of the gram CLI.

Terminal window
gram --version

Short form: -v