init scaffolds a starter Go configuration file showing every provider type, attribute layer, and alias option. manifest generate scans an SVG directory and writes a JSON index of icon names for build tooling or runtime validation.
When to use these commands
New projects: Run init to get a fully commented NewConfig() template instead of writing the builder chain from scratch. Uncomment the providers and options the project needs, delete the rest.
Build pipelines: Run manifest generate to produce a machine-readable list of available icon names from an SVG directory. The output is useful for autocomplete, name validation, or code generation.
init
Write a Go source file containing a commented NewConfig() example. The template covers all provider types (AddDirectory, AddJsonCollection, AddIconifySet, DiscoverJsonSets), attribute layers (DefaultAttributes, PrefixAttributes), aliases, fallbacks, and IgnoreNotFound.
swarm-icons initWrite to a custom path:
swarm-icons init --output config/icons.goIf the output file already exists, the command returns an error. Pass --force to overwrite.
swarm-icons init --forceFlags
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--output |
-o |
string |
swarm-icons.go |
Output file path |
--force |
-f |
bool |
false |
Overwrite an existing file |
manifest generate
Load all icons from a local SVG directory and write a sorted JSON file listing their names. The output format is:
{ "icons": [ "arrow-down", "arrow-left", "arrow-right", "home", "star" ]}Generate a manifest from a directory:
swarm-icons manifest generate --path ./iconsWrite to a custom output path:
swarm-icons manifest generate --path ./icons --output assets/icon-list.jsonFlags
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--path |
string |
Path to the SVG icon directory (required) | ||
--output |
-o |
string |
icons.json |
Output JSON file path |
See also
- JSON Commands: the
swarm-icons.jsonmanifest created byinitgovernsjson downloadandjson update - Config Builder: the
NewConfig()fluent builder that theinittemplate demonstrates - Directory Provider: the provider that consumes directories indexed by
manifest generate