Menu

Command line

skemo is a single executable. Rendering is its default command: skemo f.skemo writes f.png.

Commands

CommandRole
skemo init [file] [--css [name]]a sample diagram (diagram.skemo); with --css, a commented stylesheet it includes (skemo_style.css); overwrites nothing
skemo f.skemosame as skemo render f.skemo: writes f.png next to the source
skemo render f.skemo -o out.extthe extension picks the format: png svg webp html gif apng
skemo lint f.skemo…diagnostics only (exit code 1 on errors); --contrast adds the legibility check
skemo lint --fix f.skemo… [--dry]canonical formatting
skemo f.skemo --watchlive preview on http://127.0.0.1:8710, reloaded on every save
skemo layout f.skemo --jsonmodel, positions and routes as JSON
skemo lint f.skemo --fit [16:9] [--fix]settings (dir, wrap) that bring the diagram to a target aspect ratio; --fix applies the best one (preview)
skemo extract image.png [-o folder]gives back the source and stylesheets embedded in an image rendered by skemo, to edit them (--stdout: the source only); two stylesheets of the same name come back as skemo.css and skemo-2.css
skemo site folder -o outa website from a folder of diagrams: a card linked to another .skemo (href="shop/api.skemo") opens its page on a click; breadcrumb, list of the diagrams, pan and zoom (preview, see below)
skemo icons [query]the built-in icons, filtered by name or tag; --json for editors and completion (not listed in --help)

Render options

OptionEffect
-o FILEoutput file; - = standard output (with --format)
--format FMThtml svg png gif apng webp, when the extension is not enough
--css FILEcustom stylesheet, after the theme (repeatable)
--base-theme FILEa theme that replaces the default one
--theme Tlight dark print auto, overriding the file (auto follows the reader in HTML only; other formats are drawn light, with a warning)
--scale Nresolution of raster outputs (--scale 2 for high-density screens)
--transparentno background (SVG, PNG, APNG)
--contrast hightexts below the WCAG threshold are darkened or lightened, layout unchanged
--step Nrender one animation state
--animated, --boardone PNG per state, or a contact sheet of the states
--hold, --transition, --fps, --final-hold, --no-loop timing of GIF and APNG
--motionSVG: play the .pulse and .flow arrows (Animated flows)
--no-fontsHTML: do not embed the fonts (much smaller file)
--embed-fontsSVG: embed the fonts used, for viewers without Inter (about 0.8 MB per weight)
--font-scale Kmultiply every text size of the theme (1.4 for a slide)
--no-sourcedo not embed the source and stylesheets in the output (below)
--deny-warningsfail on any warning (useful in CI)
--allow CODEleave out the warnings of that code: not shown, not counted by --deny-warnings (--allow step-gap,overlap)

The input - reads standard input: cat f.skemo | skemo render - --format svg -o - > f.svg.

Running skemo from a tool

For a program that runs skemo (a slide tool, a CI, an editor), the command line is a stable contract (cli/SPEC.md §2):

OptionEffect
exit codes0 rendered, 1 the diagram is refused (nothing on the standard output), 2 misuse, 3 internal error
--diagnostics jsonone JSON object per line on the standard error: severity, stable code, message, file, line and column
--root DIRthe images and stylesheets the diagram names are read in this folder only (default: the diagram's)
skemo render --batchmany diagrams in one process: one JSON request per line in, one answer per line out
skemo capabilities --format jsonversion, version of the SVG conventions, features

Images that reopen

Like draw.io, every file skemo renders carries its source and its stylesheets (PNG, APNG, SVG, WebP, GIF and HTML), in metadata that viewers ignore. The image can be shared alone and edited later:

skemo extract diagram.png          # writes diagram.skemo and its stylesheets next to the image
skemo render diagram.png -o new.svg # any command also takes the image instead of the source

The editor opens such an image directly. The embedded text is readable by anyone who gets the file: render with --no-source when the source must not travel with the image.

A website of linked views

A system too large for one drawing reads better as several views: the context, then the containers of one part, then the components of one container. Link a card to the diagram that details it, then turn the folder into a site:

card#api.app(href="api.skemo") API          # in shop/containers.skemo
card#db.store(href="containers.skemo#db") DB  # back up, centred on the element

skemo site architecture/ -o public/ --css architecture/c4.css

Each .skemo becomes a page at the same place (shop/api.html). A link to a diagram shows a magnifier instead of the link glyph; a click zooms into the card and opens its page. index.skemo is the home page (without one, the home page shows a thumbnail of each diagram); the breadcrumb follows the shortest way down from it. A link to a missing diagram is a warning (site-missing-diagram); one refused diagram refuses the site. --css gives a style to every diagram; the pages follow the reader's light or dark system, with a switch (--theme light draws one theme only); the side panel's edge sets its width; --title names the site. The search box at the top (/) finds a card in every diagram, by its title, category, tag, zone or lines, and opens its page centred on it. The pages need no server and no network.

Exit codes

0success
1errors in the file
2wrong usage
3internal error

Shell completion

skemo completions bash (or zsh, fish, elvish, powershell) prints a completion script; it is not listed in --help. Load it from your shell's startup file:

eval "$(skemo completions bash)"      # ~/.bashrc
source <(skemo completions zsh)       # ~/.zshrc

Language

Help, diagnostics and messages follow the system language (LANG, LC_ALL… as usual; English and French today). SKEMO_LANG=fr overrides it. Labels the engine draws (months, centuries) follow it too, unless the diagram pins them with diagram(lang="en").

Determinism

Fonts and theme are embedded: the same file gives the same image on every machine, which makes rendered files safe to commit and compare. watch only listens on 127.0.0.1.