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

# CLI overview

> Drive Melius canvases and generations from your terminal with the mel CLI.

`mel` is the Melius command-line interface — create projects and canvases, add nodes, wire edges, run generations across the latest image, video, audio, and language models, and download the results, all from your terminal or a script.

> [!NOTE]
>
> You authenticate with an API key. Create one in the Melius app under **Team
> settings → Integrations**. See [Installation](https://docs.melius.com/cli/installation.md).

## Built for agents, great for humans

`mel` is designed **agents-first** — every command returns structured JSON, uses deterministic exit codes, and needs zero interactive input, so an AI agent in a sandbox can drive it reliably. The same qualities make it pleasant in a terminal or a shell script: predictable output you can pipe through `jq`, and clear errors that tell you the exact command to fix them.

```bash theme={null}
npm install -g @melius-ai/cli

mel auth login --api-key mel_...
mel project list
mel node create <canvasId> --type image --prompt "a sunset over the ocean"
```

## How generations work

A generation in Melius **is a canvas node** — you create a node, start a run, and wait for it to finish:

```
mel canvas create <projectId>            → a canvas
mel node create <canvasId> --type image  → a node (prompt + optional model)
mel run start <nodeId> --canvas-id <id>  → start a run
mel run wait <runId>                     → block until finished
mel run download <runId>                 → a presigned URL for the output
```

Runs are **asynchronous** — `mel run start` returns a run id immediately and the generation happens in the background. `mel run wait` blocks until it's `finished` (or `failed`). To run an entire canvas in dependency order, use `mel bulk-run start <canvasId> --wait`.

## The output contract

Every command follows the same shape, which is what makes `mel` scriptable:

* **Success** → structured JSON on `stdout`, exit code `0`
* **Errors** → structured JSON on `stderr`, a [deterministic exit code](https://docs.melius.com/cli/commands.md#exit-codes-and-errors)

Add `--text` for tab-separated human output, `--fields id,title` to project specific fields, or `--quiet` for exit-code-only. See [Global flags](https://docs.melius.com/cli/commands.md#global-flags).

## Rate limits and credits

* **Credits.** Generations consume credits from the team you act on, exactly like the app. See each model's cost in `mel model list`.
* **Rate limits.** There is no monthly request quota on any plan. On a `429`, `mel` prints a notice to stderr and automatically backs off and retries, so polling commands ride through a limit instead of failing.

## Next steps

> [card] [Installation](https://docs.melius.com/cli/installation.md)
>
> Install `mel`, create a key, and authenticate.

> [card] [Quickstart](https://docs.melius.com/cli/quickstart.md)
>
> Run your first generation end to end.

> [card] [Command reference](https://docs.melius.com/cli/commands.md)
>
> Every command, flag, exit code, and error shape.

> [card] [Using mel from an agent](https://docs.melius.com/cli/agents.md)
>
> JSON parsing, exit-code branching, and headless auth.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.