Skip to content

Command Line

The tegaki package ships a command that writes text as an animated SVG file. It needs no project setup, so it suits READMEs, slides, static sites and scripts (including coding agents) that just want a file.

npx tegaki "Tegaki is awesome"

This writes tegaki-is-awesome.svg in the current directory: the text, self-drawing and repeating forever, in Caveat.

# Draw once and stay finished, in another bundled font
npx tegaki "Hello World" --font tangerine --mode once -o hello.svg

# Overlap the letters, bigger and darker
npx tegaki "ABC" --stagger 80% --size 140 --color "#222"

# Right-to-left text is shaped and joined correctly
npx tegaki "مرحبا بالعالم" --font amiri --mode once

# Plugins by name, with or without options
npx tegaki "Brush" --plugins "taper boil"
npx tegaki "Glow" --plugins '[["glow", {"radius": 0.12, "color": "#f0a"}], "taper"]'

# Write to stdout, for piping
npx tegaki "Hi" -o - > hi.svg
Option Default Description
-o, --output <file> <slug>.svg Output path; - writes to stdout
-f, --font <name> caveat A bundled font; --list-fonts prints them
-m, --mode <mode> loop loop (repeats forever), once (draws itself once, then stays complete) or static (finished artwork, no animation)
--size <px> 100 Font size
--color <css> #1a1a1a Stroke color
--line-height <px> font metrics Line height
--stagger <advance> off Overlap glyphs instead of drawing them in sequence, e.g. 80% or 0.3 (seconds)
--speed <x> 1 Playback speed multiplier
--loop-hold <s> 1.5 In loop mode, seconds the finished text holds before fading
--letter-spacing <px> 0 Extra space after each character
--stroke-easing, --glyph-easing ease-out-quad, linear Easing of each stroke and of each glyph’s time
--pressure <0-1> 1 Variable stroke width
--clip <scale> / --no-clip 1.2 Clip strokes to the letter outlines
--plugins <list> none Plugins by name, split by spaces or commas ("taper glow"), or a JSON array of names and [name, options] pairs. See Plugins
--seed <n> 0 The seed plugins draw with: where a gradient starts, how variation changes each glyph, how boil moves the line
--no-shaping off One glyph per character, no ligatures, joining or bidi

Run npx tegaki --help for the full list.

--plugins takes the plugins tegaki/core ships, by name: glow, taper, strokeGradient, globalGradient, variation, boil and annotate. They take the same options as in the renderer (see Style plugins and the sections after it) and run in the order you list them. The file draws the ink as their geometry shapes it and timing times it, plus what their svg hooks add, so a glow comes out as an SVG filter and a gradient as SVG gradients.

# A rainbow along each stroke, thinning toward the ends
npx tegaki "Rainbow" --plugins "strokeGradient taper"

# Underline the text once it's written
npx tegaki "Note this" --plugins '[["annotate", {"mark": "underline", "color": "#e5484d"}]]'

--plugins replaces the old --effects <json> flag: --effects '{"glow":{"radius":10}}' is now --plugins '[["glow", {"radius": "10px"}]]' (a glow’s sizes are em unless they say px, so 0.12 grows with --size). Pressure width has its own flag, --pressure.

  • The text must fit the character set of the chosen font. See Getting Started for the bundled fonts.
  • It writes SVG only. For PNG, GIF or WebM, use Tegaki Studio; for an app, use the renderer.