The swarm-icons binary manages Iconify icon sets from the terminal. Browse the catalog, download JSON files, search and export icons, and generate manifests, all without Node.js.
When to use the CLI
The CLI is a development-time companion to the go-swarm-icons library. It handles three workflows:
-
Building a local icon library: Browse the full Iconify catalog with
json browse, download the sets a project needs withjson download, and keep them current withjson update. The downloaded JSON files feedJsonCollectionProviderat runtime. -
Exploring and exporting icons: Search sets by keyword with
icon search, list everything in a prefix withicon list, and export individual SVGs withicon exportfor use withDirectoryProvideror as standalone assets. -
Project setup and tooling: Scaffold a starter configuration with
init, pre-warm the Iconify API cache for offline builds withcache warm, and generate icon name manifests for build pipelines withmanifest generate.
Installation
The CLI is a separate Go module. It is not required by any library import.
go install github.com/frostybee/go-swarm-icons/cmd/swarm-icons@latestVerify the installation:
swarm-icons --helpCommands
| Command | Description |
|---|---|
init |
Generate a starter Go configuration file |
json download |
Download Iconify JSON sets from the npm registry |
json update |
Check for and apply updates to downloaded sets |
json browse |
Browse all available Iconify icon sets |
icon export |
Export icons as individual SVG files |
icon list |
List available icons from a directory, JSON set, or the API |
icon search |
Search for icons by name within an icon set |
cache warm |
Pre-fetch icons from the Iconify API and cache them on disk |
cache clear |
Clear the icon cache directory |
manifest generate |
Generate a JSON manifest of icon names from a directory |
See also
- Installation: install the core library module and optional submodules
- JSON Collection Provider: use downloaded JSON files at runtime
JSON Commands
Documents flags for browsing, downloading, and updating Iconify sets from the npm registry.
Icon Commands
Documents flags for the export, list, and search subcommands and their source modes.
Cache Commands
Covers flags for pre-fetching icons to disk and wiping the cache directory.
Init & Manifest
Covers flags for scaffolding a config file and indexing a directory's icon names.