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.
- For an agent over MCP: nothing to install. Your client runs Levni through
npx. Jump to MCP server for the one-line setup. - For the CLI or Node API: install from npm.
npm install @levni/levni npx @levni/levni list coffeeThe
levnicommand is now available throughnpxinside that project. Install globally withnpm install -g @levni/levniif you want it everywhere. - 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/levniOr 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" }
] }
rocket is a drawing from the library, shadow adds a cast shadow, rot tilts it.Render it:
npx @levni/levni render scene.json out.pngThe 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
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" } }
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 }
] }
- 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 deliberateThe 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.pngwritesout.pngin the current folder.levni posterwrites a whole folder. - MCP files.
outandout_dirare 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 addwrites 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, setLEVNI_PROPS=/path/to/props(several folders separated by:). - Optional icons. The
iconandasciielements use Tabler Icons when@tabler/iconsis installed (orLEVNI_ICONS=/path). Nothing else needs it. - Keys. Drawing needs none. The Ghost adapter and the judge take their keys from your environment.
Where next
- Using an agent: MCP server, with every tool and a sample session.
- Writing scenes by hand: Scenes and Elements.
- Brand work: Brand boards and Branding posters.
- Every command: Command line. From code: Node API.