CLI
npx magic-glyphs --helpFinding icons
Section titled “Finding icons”magic-glyphs search shopping cart # best matches firstmagic-glyphs search arrow --category ui --limit 10magic-glyphs list --category arrowsmagic-glyphs categoriesmagic-glyphs info heartAdd --json to search and list for machine-readable output.
Adding icons to a project
Section titled “Adding icons to a project”magic-glyphs add <name...> [options]magic-glyphs add --category <category> [options]magic-glyphs add --all [options]| Option | Meaning | Default |
|---|---|---|
--format |
svg, lottie, react, vue, json, html |
svg |
--style |
outline, solid, duotone, glass |
outline |
--out |
Folder to write into | ./magic-glyphs |
--color |
Main colour, hex | currentColor for SVG, #000000 for Lottie |
--secondary |
Duotone fill colour, hex | same as --color |
--background |
Colour knocked out of solid icons | #ffffff |
--size |
SVG width and height in px | 24 |
--stdout |
Print one icon instead of writing a file | off |
--dry-run |
Report what would be written | off |
What each format writes
Section titled “What each format writes”| Format | File | Animated |
|---|---|---|
svg |
heart.svg |
No. A still image. |
lottie |
heart.lottie.json |
Yes |
react |
HeartGlyph.jsx |
Yes (needs the magic-glyphs package) |
vue |
HeartGlyph.vue |
Yes (needs the magic-glyphs package) |
json |
heart.json |
Raw data for MagicGlyphs.register |
html |
heart.html |
The <magic-glyph> tag |
Files for non-outline styles carry the style in the name, for example heart.duotone.svg.
Exit codes
Section titled “Exit codes”0 on success, 1 on any error. Errors go to stderr and say what to do next.
Licence and bundles
Section titled “Licence and bundles”npx magic-glyphs login YOUR-LICENCE-KEY # the key from your Gumroad receipt (no < > around it); downloads the full librarynpx magic-glyphs buy # opens the page where you can buy a licencenpx magic-glyphs update # tells you if a newer version is out, then downloads new paid iconsnpx magic-glyphs build-key # a key for CI and build servers that does not use a devicenpx magic-glyphs shadcn --env # connect a shadcn project (see the shadcn guide)npx magic-glyphs --versionnpx magic-glyphs licence # who this computer is licensed tonpx magic-glyphs licence --show-key # prints the key to use on a build servernpx magic-glyphs sync # download the full library againnpx magic-glyphs logout
npx magic-glyphs bundle --out public/magic-glyphs.js # runtime plus every icon you are licensed fornpx magic-glyphs bundle heart bell cart --out public/icons.js # runtime plus only thesenpx magic-glyphs static --out public/icons --styles outline,solidOn a build server, set the MAGIC_GLYPHS_KEY environment variable instead of running login, then run sync.
Your own icons
Section titled “Your own icons”Icons from the icon maker (exported as icon data, .json) work with every command. They need no licence:
npx magic-glyphs add my-logo --from my-icons/ --format react --out src/iconsnpx magic-glyphs static --from my-icons/ --out public/iconsMAGIC_GLYPHS_CUSTOM=./my-icons npx magic-glyphs add my-logo --stdout--from takes a file or a folder. MAGIC_GLYPHS_CUSTOM loads them for every command and for the MCP server, so your coding assistant can use them too. Files are checked so they can only contain drawing, motion and sound settings.