Technical Reference
CLI overview
Overview
Section titled “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.
Installation
Section titled “Installation”Install the gram CLI with one of the following methods:
curl -fsSL https://go.getgram.ai/cli.sh | bashAfter installation, run the following command to verify that the CLI is installed correctly:
gram --versionThen authenticate:
gram authAuthentication
Section titled “Authentication”Use gram auth to bootstrap an account:
gram authThen, inspect the current profile:
gram whoamiThe first time gram auth runs, it creates and saves a producer-scoped API
key in the dashboard.
Available commands
Section titled “Available commands”Global CLI options
Section titled “Global CLI options”The following global options are available across CLI commands.
api-key
Section titled “api-key”Use api-key to provide an API key (which must have the producer scope):
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_KEYenvironment variable - The
secretfield of the current profile in~/.gram/profile.json
project
Section titled “project”Use project to provide the target project’s slug:
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_PROJECTenvironment variable - The
defaultProjectSlugfield of the current profile in~/.gram/profile.json
Use org to provide the target organization’s slug:
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_ORGenvironment variable - The organization of the current profile in
~/.gram/profile.json
log-level
Section titled “log-level”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:
gram --log-level debug [command] [command options]The base log level can also be set via the GRAM_LOG_LEVEL environment variable.
log-pretty
Section titled “log-pretty”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:
gram --log-pretty=false [command] [command options]Pretty logging can also be toggled via the GRAM_LOG_PRETTY environment variable.
profile
Section titled “profile”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:
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:
gram [command] --helpShort form: -h
version
Section titled “version”Use version to print the version of the gram CLI.
gram --versionShort form: -v