Leonardo Cli banner
mrgoonie mrgoonie

Leonardo Cli

AI community

Description

Leonardo.Ai CLI — generate images, videos, upscales. AI-agent and human friendly.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

leonardo-cli

![leonardo-cli banner](./assets/banner.jpg)

A Leonardo.Ai command-line interface for generating images, videos, upscales, and more.

Designed to be both **AI-agent friendly** (`--json`, deterministic exit codes, stderr logs) and **human friendly** (colors, progress, helpful errors).

$ leonardo generate "a cyberpunk cat" -o cat.png
→ Submitting generation (1024x1024, n=1)
  generationId: 4f8e...
→ Polling for completion...
  attempt 1 — status: PENDING
  attempt 2 — status: COMPLETE
✓ Saved cat.png (812345 bytes)
done 1 image(s)

Install

Requires [Bun](https://bun.sh) ≥ 1.1.

git clone https://github.com/mrgoonie/leonardo-cli.git
cd leonardo-cli
bun install

# run from source
bun run leonardo --help

# or build a single executable
bun run build && ./dist/cli.js --help

After `npm i -g leonardo-cli` you get two binaries pointing to the same CLI:

  • leonardo — full name
  • leo — short alias

API Key

Get a key at .

The CLI resolves your API key in this order — **first match wins**:

Priority Source Example
1 --api-key flag leonardo --api-key lk_… me
2 LEONARDO_API_KEY env var (incl. OS-level shell) export LEONARDO_API_KEY=lk_…
3 .env.local / .env.*.local / .env (walks up from cwd) see .env.example
4 ./leonardo.config.json (walks up from cwd) see leonardo.config.example.json
5 User config: $XDG_CONFIG_HOME/leonardo-cli/config.json (default ~/.config/leonardo-cli/config.json) written by leonardo config set

Inspect what was resolved:

leonardo config path        # paths + which source the key came from
leonardo config show        # effective config (key redacted)
leonardo config set apiKey lk_xxx

Output

Single file:

leonardo generate "a sunset" -o sunset.png

Directory (auto-named: `leonardo--NN.png`):

leonardo generate "a sunset" -d ./outputs -n 4

Skip