Skip to content

Configuration ​

The CLI reads a single project config file. This page documents the file lookup and the schema that @moewolf/[email protected] validates. Because the CLI workflow is not yet consumable, see CLI status.

File name and lookup ​

The CLI uses the first existing file, in this order:

  1. moeicons.config.jsonc
  2. moeicons.config.json
  3. moeicons.config.ts
  4. moeicons.config.js

JSON and JSONC are supported (comments and trailing commas allowed). TypeScript and JavaScript configs are rejected with a message asking for moeicons.config.jsonc. moeicons init writes moeicons.config.jsonc.

Schema versions ​

schemaVersionNotes
1Legacy: requires framework (react/vue), forbids target. Migrated to target in memory.
2Requires target, rejects framework. Written by init.

Schema version 3, downloadMode and the integration block are not part of 0.0.1. They exist only in unreleased work.

Example ​

jsonc
{
  "schemaVersion": 2,
  "tier": "free",
  "target": "react",
  "outputDir": "src/moeicons",
  "defaultTheme": "outline",
  "icons": ["ui-search", "arrow-bold-right"],
  "themes": {
    "outline": { "styleGroup": "moe-outline" },
    "solid": { "styleGroup": "moe-solid" }
  }
}

init writes a larger skeleton with all icons grouped by prefix; a flat array is also accepted.

Top-level fields ​

FieldType / allowedDefaultEffect
schemaVersion1 | 2—Validation/migration mode.
tierfree | pro—Download tier; must match the install command.
targetreact | vue | vanilla | assetsreactOutput type.
outputDirrelative POSIX pathsrc/moeiconsGenerated file location.
defaultThemekey of themesoutlineInitial theme.
themesobject—Theme key → theme entry.
iconsstring[] or { prefix: string[] }—Registered icon IDs; must be non-empty before install.
missingIconPolicyfallback | errorfallbackAccepted by the schema; see the note below.

Theme entry fields ​

FieldType / allowedNotes
styleGroupmoe-* stringRequired. Must exist in the catalog.
stylesstring[]Legacy, accepted for migration.
formatsvg | webp | pngBitmap groups only.
imageSize64 | 128 | 256 | 512Bitmap groups only.
defaultSizenumber > 0Accepted; effect on generated SVG proxies is not guaranteed.
strokeWidthnumber >= 0Accepted.
classNamestringApplied to the theme's generated icons.

A theme entry cannot contain an icons field in 0.0.1; doing so fails with unknown field "icons" in theme "<name>". Use the top-level icons list.

Icon registration and validation ​

  • icons registers the allowed IDs. Install requires at least one.
  • The generator checks that every registered icon exists in every configured theme's style group. If an icon is missing from any theme, generation fails: icon "<id>" is not available in style group "<group>" for theme "<theme>".
  • There is no per-theme subset and no "requested theme → default → ASCII fallback" selection in 0.0.1; missingIconPolicy is accepted but does not implement that behaviour.

Catalog and Free group caveat ​

The 0.0.1 package bundles catalog 0.0.17, in which moe-colored is still Pro-only. A Free config that uses moe-colored fails with style group "moe-colored" is not available in free tier. The website and the current Free release contract treat moe-colored as Free; the CLI catalog lags behind. Until the CLI is updated, use moe-outline, moe-lite-outline and moe-solid for Free CLI configs.

After changing configuration ​

The 0.0.1 release has no update command. Change the config, then run install and generate again.

Common errors ​

Message (abridged)Cause
unknown field "icons" in theme ...Per-theme icons is unsupported.
style group "moe-colored" is not available in free tier0.0.1 catalog lag.
icon "<id>" is not available in style group ...Icon missing from a configured theme.
unknown icon "<id>"ID not in the catalog.
Unsupported/invalid schemaVersionNot 1 or 2.