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

# Quickstart

> Generate your first image with the mel CLI in a few minutes.

## 1. Install and authenticate

```bash theme={null}
npm install -g @melius-ai/cli
mel auth login --api-key mel_...
```

Don't have a key yet? Create one in the app under **Team settings → Integrations**. See [Installation](/cli/installation) for details.

## 2. Generate your first image

These commands create a project and canvas, add an image node with your prompt, run it, wait for the generation to finish, and print the URL of the result.

```bash theme={null}
# Create a project and a canvas
PROJECT=$(mel project create --title "My first project" --fields id --text)
CANVAS=$(mel canvas create "$PROJECT" --title "My first canvas" --fields id --text)

# Add an image node
NODE=$(mel node create "$CANVAS" --type image \
  --prompt "a golden retriever puppy in a field" \
  --aspect-ratio 1:1 --fields id --text)

# Run it and block until it's done
RUN=$(mel run start "$NODE" --canvas-id "$CANVAS" --fields id --text)
mel run wait "$RUN"

# Get the URL of the generated image
mel run download "$RUN"
```

No model is specified, so Melius picks one for you. To choose one, add `--model <name> --variant <variant>` (discover options with `mel model list --category image`).

<Tip>
  Every create command returns the created object as JSON. `--fields id --text` prints just the `id` so you can capture it in a shell variable — drop those flags to see the full object.
</Tip>

## 3. Or build a whole pipeline in one call

`mel node bulk-create` creates multiple nodes and the edges between them at once — ideal for a text-to-image pipeline:

```bash theme={null}
mel node bulk-create "$CANVAS" --json - <<'EOF'
{
  "nodes": [
    { "id": "brief", "type": "text",  "prompt": "Describe a premium product photo" },
    { "id": "hero",  "type": "image", "prompt": "Professional product shot", "aspectRatio": "1:1" }
  ],
  "edges": [ { "src": "brief", "dst": "hero", "type": "text" } ]
}
EOF

# Run every node on the canvas in dependency order, and wait
mel bulk-run start "$CANVAS" --wait
```

`mel bulk-run` executes nodes tier by tier — downstream nodes wait for their inputs to finish.

## Generate video, too

Everything works the same for video — use `--type video` and a `--duration` in seconds:

```bash theme={null}
VIDEO=$(mel node create "$CANVAS" --type video \
  --prompt "a slow timelapse of clouds over a city skyline" \
  --duration 5 --aspect-ratio 16:9 --fields id --text)

RUN=$(mel run start "$VIDEO" --canvas-id "$CANVAS" --fields id --text)
mel run wait "$RUN"
mel run download "$RUN"
```

Discover video models and their options with `mel model list --category video`.

## 4. Read the result

```bash theme={null}
mel canvas content "$CANVAS" --node-id "$NODE" --include-all-versions
```

`mel canvas content` is the primary read command — it returns the live canvas state (nodes, edges, and generated outputs).

## Next steps

<Columns cols={2}>
  <Card title="Command reference" icon="terminal" href="/cli/commands">
    Every command, flag, exit code, and error shape.
  </Card>

  <Card title="Using mel from an agent" icon="robot" href="/cli/agents">
    JSON parsing, exit-code branching, and headless auth.
  </Card>
</Columns>
