Skip to content

CLI overview

The Gram CLI is a powerful tool that allows you to manage and deploy your MCP servers directly from your terminal. With the CLI, you can create new projects, configure toolsets, deploy servers, and monitor their performance with ease.

Install the Gram CLI with one of the following methods:

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

Terminal window
gram --version

Then authenticate yourself with your Gram account:

Terminal window
gram auth

Use gram auth to bootstrap your account:

Terminal window
gram auth

Then, inspect your current user information:

Terminal window
gram whoami

The first time you run gram auth, it creates and saves a Producer key in your Gram dashboard.

You can provide any Gram CLI command with the following global options.

Use api-key to provide your Gram API key (which must be scoped as a ‘Provider’):

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 your target Gram 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 log-level to set the base log level (the default is info):

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

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

Use log-pretty to toggle pretty logging off. (By default, this option is set to true.)

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

You can also enable and disable pretty logging set via the GRAM_LOG_PRETTY environment variable.

Use profile to provide the profile name to use from ~/.gram/profile.json:

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

You can also set the profile name 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