Skip to main content

1. Install and authenticate

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

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:
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:
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

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

Command reference

Every command, flag, exit code, and error shape.

Using mel from an agent

JSON parsing, exit-code branching, and headless auth.
Last modified on July 1, 2026