On this page

Start

Getting started

Install Levni, draw one picture, learn to read its critic. Two minutes, no account and no key.

Want to see it before you install anything? Open the editor: it runs the same engine in your browser. To use Levni from Claude or Codex for free, add the MCP server.

Requirements

Node.js 20 or newer. Levni has two dependencies, sharp (SVG to PNG and WebP) and fontkit (reads the bundled fonts), which npm installs for you. Everything runs locally.

Install

Pick the route that matches how you will use it.

  1. For an agent over MCP: nothing to install. Your client runs Levni through npx. Jump to MCP server for the one-line setup.
  2. For the CLI or Node API: install from npm.
    npm install @levni/levni
    npx @levni/levni list coffee

    The levni command is now available through npx inside that project. Install globally with npm install -g @levni/levni if you want it everywhere.

  3. For the newest features: install from GitHub. Branding posters and the type engine are in 0.3.0, which is not published to npm yet.
    npm install github:Levni-Dev/levni

    Or work from a checkout, which is also how you contribute drawings:

    git clone https://github.com/Levni-Dev/levni.git
    cd levni && npm install
    node bin/levni.mjs list coffee

Your first render

A scene is a JSON object. elements are drawn in order, each on top of the last, on a 1200 by 673 canvas. Save this as scene.json:

{ "seed": 5, "elements": [
  { "type": "disc", "x": 600, "y": 336, "r": 250, "color": "mustard" },
  { "type": "prop", "name": "rocket", "x": 600, "y": 336, "size": 380, "rot": 20, "shadow": true },
  { "type": "label", "text": "Launch / Day one", "x": 80, "y": 90, "color": "ink" }
] }
A rocket tilted over a mustard disc, with a small blue label reading Launch / Day one
The result: rocket is a drawing from the library, shadow adds a cast shadow, rot tilts it.

Render it:

npx @levni/levni render scene.json out.png

The output extension picks the format: .png, .webp or .svg. Add --preview to also write a 560 px out.png.prev.jpg, and --format og (or cover, square, story, youtube) to recompose the scene for another canvas.

A cover like this renders in about 0.15 seconds on a laptop, so trying ten variations costs you a couple of seconds.

Not sure which drawing to use? Search the library, then look at it:

npx @levni/levni list lighthouse               # names, variant counts, tags
npx @levni/levni sheet look.png rocket dove    # every variant, on paper and on blue
A contact sheet: every variant of rocket, lighthouse and dove, drawn on paper and on a blue panel, each labelled with its name and variant number
A contact sheet. The label under each drawing, such as rocket 1, is the name and variant number to put in a scene.

Drawings can be recoloured per element, so one library matches your brand:

{ "type": "prop", "name": "rocket",
  "x": 600, "y": 336, "size": 330,
  "recolor": { "coral": "blue" } }
Three rockets side by side: the original, one with the coral parts turned blue, one with coral turned mustard and blue turned green
The same drawing three times: as drawn, coral to blue, and two swaps at once.

Read the critic

Every render ends with notes from the layout critic. It is cheap, quick and blind to meaning, so look at the picture too. With nothing to report it prints critic: no layout problems found. Here is a scene with a rocket pushed too far right:

{ "seed": 2, "elements": [
  { "type": "prop", "name": "rocket", "x": 1150, "y": 336, "size": 380 },
  { "type": "prop", "name": "lighthouse", "x": 200, "y": 560, "size": 200 }
] }
A rocket cut off by the right edge of the canvas and a small lighthouse at the lower left
The rocket runs off the right edge.
- draw "rocket" (ink box 983,188 305×315) is cut by the frame, 71% shows: pull it in, or set "crop": true if the cut is deliberate

The critic reports at most six notes: elements off the canvas, accidental crops, lopsided weight, no clear focal symbol, icons overlapping. Fix them by moving or resizing, or set "crop": true when the cut is on purpose. An agent does exactly this loop over MCP.

Where files go

  • Output. Wherever you point it. levni render scene.json out.png writes out.png in the current folder. levni poster writes a whole folder.
  • MCP files. out and out_dir are relative to the working directory of your MCP client, so launch the client in your project folder.
  • The library. Drawings live in library/props/ as one JSON file each. levni add writes into the library of the checkout it runs from, or into --dir. New drawings follow the naming and tagging rules. To use your own folder of drawings without touching the library, set LEVNI_PROPS=/path/to/props (several folders separated by :).
  • Optional icons. The icon and ascii elements use Tabler Icons when @tabler/icons is installed (or LEVNI_ICONS=/path). Nothing else needs it.
  • Keys. Drawing needs none. The Ghost adapter and the judge take their keys from your environment.

Where next

Found a mistake? These pages come from the docs folder and the CLI help; fix it there and open a pull request.

Free, for real

Make one now. Keep making them for free.

Try Levni in your browser, then add it to Claude or Codex: it draws on your machine, so the $20 plan you already have is enough. No image credits, no second bill.