# Inngest CLI

Inspect runs, fetch traces, invoke functions, and give coding agents access to your Inngest data from the terminal.

```bash {{ title: "bash" }}
curl -sfL https://cli.inngest.com/install.sh | sh
```

```bash {{ title: "brew" }}
brew install inngest/tap/inngest

# If Homebrew warns about untrusted taps, run this and then install again
brew trust --cask inngest/tap/inngest
```

```bash {{ title: "npm" }}
npm install -g inngest-cli
```

***

## Quick start

Sign in with OAuth and start inspecting Cloud runs:

```bash
inngest login
```

Complete the browser approval and choose the access you need. These examples inspect `production`; replace it with your environment's slug.

```bash
# Get a function run
inngest api --prod --env production get-function-run 01KTCTWT8XDEGWDMVX3Q9M69ND

# Get runs triggered by an event
inngest api --prod --env production get-event-runs 01KTCTWSZJEKAFEDA4F9GYHFQW --include-output --limit 5

# Invoke a function locally
inngest api invoke-function my-app my-function --data '{"message": "hello"}'

# Fetch a full trace
inngest api --prod --env production get-function-trace 01KTCTWT8XDEGWDMVX3Q9M69ND --include-output
```

The CLI auto-generates commands from the Inngest v2 REST API. Every API endpoint is available as a subcommand under `inngest api`.

***

## Authentication

### OAuth (recommended)

Run `inngest login` and complete the browser approval. Choose your account, environment access, permissions, and session duration. Use read permissions to inspect data, and grant write permissions only for operations you need to perform.

The CLI stores credentials in your operating system's credential store and refreshes access tokens automatically. OAuth scopes limit the operations the session can perform, and your current account role also limits its access.

```bash
inngest auth status
inngest logout
```

`auth status` shows the current login. `logout` revokes the session and removes its local credentials. Use `inngest login --force` to sign in again with different permissions. Use `inngest login --no-browser` to open the displayed approval URL manually.

If no operating system credential store is available, `inngest login --insecure-storage` explicitly opts into a plaintext file readable only by your user. Use this only in a trusted environment.

### API keys (optional)

For CI or unattended scripts, create an [API key](/docs-markdown/platform-and-operations/keys-and-access?ref=docs-cli) in the dashboard with the required permissions and environment access:

```bash
export INNGEST_API_KEY=sk-inn-api-...
```

API keys override the stored OAuth login. Unset `INNGEST_API_KEY` and remove explicit key flags when switching to OAuth.

### Credential precedence

For API commands, the CLI checks credentials in this order:

1. `--api-key` flag (explicit override)
2. `INNGEST_API_KEY` environment variable
3. `--signing-key` flag
4. Stored OAuth login for the target API host
5. `INNGEST_SIGNING_KEY` environment variable (fallback)

The local Dev Server does not require authentication.

***

## Dev server vs cloud

The CLI targets your local dev server by default. Use `--prod` to hit Inngest Cloud:

```bash
# Local dev server (default)
inngest api get-function-run 01ABC123

# Inngest Cloud
inngest api --prod --env production get-function-run 01ABC123

# Custom API host
inngest api --api-host http://localhost:8288 get-function-run 01ABC123
```

Target resolution:

1. `--api-host` or `--api-port` flags
2. `--prod` flag
3. Default: local dev server

Signing in does not change the target: use `--prod` for Cloud. For environment-specific requests with a session or key that allows all environments, select an environment with `--env <slug>` or `INNGEST_ENV`. A session or key bound to one environment uses that environment and cannot access another one.

***

## Available commands

All commands live under `inngest api`. Run `--help` on any command to see its options:

```bash
inngest api --help
inngest api get-function-run --help
```

### Runs

| Command                       | Description                                                 |
| ----------------------------- | ----------------------------------------------------------- |
| `get-function-run <run_id>`   | Get a function run summary                                  |
| `get-function-trace <run_id>` | Get the full trace with step spans                          |
| `get-event-runs <event_id>`   | List runs triggered by a specific event                     |
| `rerun <run_id>`              | Rerun a function from the beginning or from a selected step |

### Functions

| Command                                  | Description                           |
| ---------------------------------------- | ------------------------------------- |
| `invoke-function <app_id> <function_id>` | Invoke a function with a JSON payload |

Common flags:

- `--include-output` includes step and run output in the response
- `--limit N` limits the number of results
- `--prod` targets Inngest Cloud instead of the dev server
- `--env <slug>` selects a Cloud environment within your granted access

***

## Output format

The CLI outputs compact JSON by default. Pipe to jq or other tools:

```bash
# Get just the status
inngest api --prod --env production get-function-run 01ABC123 | jq '.data.status'

# Pretty print
inngest api --prod --env production get-function-run 01ABC123 | jq .
```

***

## Related

- [Debug a function run from your terminal](/docs-markdown/guides/debug-with-cli) for a step-by-step guide
- [Rerun function runs](/docs-markdown/platform/manage/rerun-function-runs?ref=docs-cli) from the beginning or from a selected step
- [Use the CLI with coding agents](/docs-markdown/ai-patterns/cli-for-coding-agents) to give Claude Code, Cursor, or Codex access to your Inngest data
- [REST API documentation](https://api-docs.inngest.com) for the full API reference
- [API Keys](/docs-markdown/platform-and-operations/keys-and-access) for key management