> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runcomfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

The **runcomfy CLI** runs RunComfy AI media models from your terminal or any AI agent. It wraps the [Model API](/model-apis/quickstart) so you can submit a request, wait for completion, and have the result automatically downloaded — in one command.

```bash theme={null}
runcomfy run openai/gpt-image-2/text-to-image \
  --input '{"prompt": "a small purple cat at sunset"}'
```

**Repository**: [runcomfy-com/runcomfy-cli](https://github.com/runcomfy-com/runcomfy-cli)

***

## What it gives you

* **One command end-to-end** — submit, poll, fetch the result, and download generated files into your working directory.
* **Pipe-friendly** — `--output json` emits a single line of JSON to stdout (stderr stays empty in JSON mode), so `runcomfy ... | jq ...` works in scripts.
* **AI-agent-friendly** — every progress line goes to stderr; final payload to stdout; `sysexits`-style exit codes (`64` usage / `65` data / `69` upstream / `75` retryable / `77` auth) so callers branch on failure type without parsing strings.
* **Browser OAuth** — `runcomfy login` opens a device-code flow in your browser. No long-lived API key copy-paste, and no token in your shell history.
* **Streaming downloads, with safety** — multi-hundred-MB video outputs stream straight to disk; downloads are restricted to RunComfy CDN hosts so a compromised model can't trick the CLI into pulling arbitrary content.

***

## Commands at a glance

| Command                                       | Purpose                                                 |
| --------------------------------------------- | ------------------------------------------------------- |
| [`login`](/cli/commands#login)                | OAuth authentication via the browser (device-code flow) |
| [`logout`](/cli/commands#logout)              | Clear the local token                                   |
| [`whoami`](/cli/commands#whoami)              | Show the currently authenticated user                   |
| [`run`](/cli/commands#run)                    | Run a Model API model end-to-end                        |
| [`status`](/cli/commands#status)              | Poll a Model API request's status                       |
| [`cancel`](/cli/commands#cancel)              | Cancel a queued or running request                      |
| [`completion`](/cli/install#shell-completion) | Generate a shell completion script                      |

Aliases: `runcomfy requests get` and `runcomfy requests cancel` are equivalent to `runcomfy status` / `runcomfy cancel`.

***

## Next steps

* [**Quickstart**](/cli/quickstart) — install, log in, generate your first image.
* [**Install**](/cli/install) — npx, `npm i -g`, `curl install.sh`, build from source.
* [**Authentication**](/cli/auth) — device-code flow, `RUNCOMFY_TOKEN` for CI, where the token is stored.
* [**Troubleshooting**](/cli/troubleshooting) — exit codes, common errors, proxy issues.
