Skip to content
Xerobi Icons

Tools and scripts

Reference for the commands used to work on icons and releases: icon.py, lint, audit, weights, build, tests and the first-publish helper.

Last updated

Everything below is run from tooling/generator unless it says otherwise. Prefix commands with uv run so Python and its dependencies are set up for you.

icon.py

The one entry point for contributors. Standard library only (except weights, which uses the build dependencies for new icons).

Command Does
icon.py search <words> Finds icons by name, tag or retired name, best match first
icon.py new <name> -c Category -t a,b,c [--from base] Scaffolds icons/<name>.svg, from a placeholder or a copy of base
icon.py import <file.svg> <name> -c Category -t a,b,c Turns an SVG exported from a design tool into a source file
icon.py check [names] Lint and consistency audit for these icons, or all of them
icon.py weights <names> Draws all six weights at 12 to 48 px on light and dark into build/weights.svg
icon.py rename <old> <new> [--variants] Renames an icon and records the alias
icon.py review <name> Prints the pull request checklist with automatic results filled in

lint.py and audit.py

Command Does
lint.py Runs every rule on every icon. Exit 1 on a new problem
lint.py --all Also lists problems that are in the baseline
lint.py --update-baseline Shrinks the baseline after you fixed icons. Refuses to grow it
lint.py --rules The rules as JSON
audit.py Prints how many icons are outliers for stroke, size, centre, corners, dots
audit.py --check Exit 1 on outliers not in audit-baseline.json
audit.py report.md Writes the full list of outliers

See Lint rules.

weights.py

Command Does
weights.py <names> The contact sheet (same as icon.py weights)
weights.py --report Counts icons whose fill equals regular, whose duotone has no tint, and any that clip
weights.py --report --list The same, with the names

Build

Command Does
bun run build:data Outlines every icon into build/icons.json and svg/ (about a minute)
bun run build Generates every package into packages/ from that data
bun run build:all Both
bun run test Package and tooling tests
bun run test:browser The web component in a real browser (needs Playwright)

From the repository root, bun run build runs turbo: the icon data, the packages, and the website. bun run dev starts the website.

Releases

Command Does
node scripts/first-publish.mjs npm [--yes] The one-time manual first publish to npm. Dry run without --yes
node scripts/first-publish.mjs pub [--yes] The same for pub.dev
bun run package in apps/figma-plugin Builds the Figma plugin zip

See Publishing.

Files you edit, and files you do not

Path Edit?
tooling/generator/icons/*.svg yes: the source of truth
tooling/generator/aliases.json through icon.py rename
tooling/generator/scripts/*.json baselines only shrink
tooling/generator/build/, svg/ no, generated and ignored by git
packages/*, Package.swift no, generated and committed at release
apps/web/src/content/docs/*.mdx yes: this documentation