# CLI overview

## 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.

## Installation

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:

```bash
gram --version
```

Then authenticate yourself with your Gram account:

```bash
gram auth
```

## Authentication

Use `gram auth` to bootstrap your account:

```bash
gram auth
```

Then, inspect your current user information:

```bash
gram whoami
```

The first time you run `gram auth`, it creates and saves a [Producer
key](/docs/mcp/secure/api-keys#producer-keys) in your Gram dashboard.

## Available commands

<div className="grid md:grid-cols-4 sm:grid-cols-2 gap-4 w-[42rem] mx-auto">
    <a href="/docs/mcp/reference/command-line/auth">- auth</a>
    <a href="/docs/mcp/reference/command-line/install">- install</a>
    <a href="/docs/mcp/reference/command-line/push">- push</a>
    <a href="/docs/mcp/reference/command-line/stage">- stage</a>
    <a href="/docs/mcp/reference/command-line/stage-function">- stage function</a>
    <a href="/docs/mcp/reference/command-line/stage-openapi">- stage openapi</a>
    <a href="/docs/mcp/reference/command-line/status">- status</a>
    <a href="/docs/mcp/reference/command-line/update">- update</a>
    <a href="/docs/mcp/reference/command-line/whoami">- whoami</a>
</div>

## Global CLI options

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

### <code>api-key</code>

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

```bash
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`

### <code>project</code>

Use `project` to provide your target Gram project's slug:

```bash
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`

### <code>log-level</code>

Use `log-level` to set the base log level (the default is `info`):

```bash
gram [command] --log-level debug [command options]
```

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

### <code>log-pretty</code>

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

```bash
gram [command] --log-pretty=false [command options]
```

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

### <code>profile</code>

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

```bash
gram [command] --profile production [command options]
```

You can also set the profile name via the `GRAM_PROFILE` environment variable.

### <code>help</code>

Use `help` to view the help information for any command:

```bash
gram [command] --help
```

Short form: `-h`

### <code>version</code>

Use `version` to print the version of the Gram CLI.

```bash
gram --version
```

Short form: `-v`
