Goal: add a clean configuration system for both project-level defaults and user-level defaults, plus a generated JSON schema and typed TS definitions for editor tooling.
- Add a local config file for per-project behavior.
- Add a global config file for user-wide behavior.
- Generate root JSON schema files from a
config-genpackage using Zod v4. - Wire
svg_view_cmdinto TUI open behavior (o) for both local icons and Iconify search results.
- Filename:
iconmate.config.json(in project root). - Intended usage: checked into repo, shared with the team.
- Keys:
folder(local only)preset(local only)output_line_template(local only)svg_view_cmd(local + global)
- Intended usage: personal machine defaults.
- Initial key support:
svg_view_cmd
- Suggested paths (using OS conventions):
- macOS:
~/Library/Application Support/iconmate/config.json - Linux:
~/.config/iconmate/config.json - Windows:
%APPDATA%\\iconmate\\config.json
- macOS:
folder- Scope: local only
- Type:
string - Default:
src/assets/icons
preset- Scope: local only
- Type:
string - Default: empty (
"") which means plain SVG mode
svg_view_cmd- Scope: local + global
- Type:
string - Default behavior:
- macOS: open with Quick Look
- Linux: open with system browser
- Windows: open with default browser
- Custom value examples:
zed %filename%code %filename%
- Token support:
%filename%= full path to the SVG file to open
output_line_template- Scope: local only
- Type:
string - Default:
export { default as Icon%name% } from './%icon%%ext%'; - Variables:
%name%%icon%%ext%
- For
folder,preset, andoutput_line_template: CLI flag > local config > built-in default. - For
svg_view_cmd: CLI flag (if added later) > local config > global config > OS default. - Unknown keys should be ignored with a warning (non-fatal).
- Local icon list:
- pressing
oopens the existing file via resolvedsvg_view_cmd.
- pressing
- Iconify search results:
- pressing
odownloads the SVG to a cache file, then opens it via resolvedsvg_view_cmd.
- pressing
- Use OS data directory with an
iconmatenamespace. - Suggested cache root:
- macOS:
~/Library/Application Support/iconmate/cache/iconify - Linux:
~/.local/share/iconmate/cache/iconify - Windows:
%LOCALAPPDATA%\\iconmate\\cache\\iconify
- macOS:
- Cache filename strategy:
<prefix>__<icon>.svg(sanitized for filesystem safety).
- Create folder:
config-gen/. - Add
config-gen/package.json. - Use Zod v4 as source of truth for config schemas and descriptions.
- Define schemas in TypeScript and generate:
- local/global config TS types
iconmatelocal.schema.jsonat repo rooticonmateglobal.schema.jsonat repo root
Suggested layout:
config-gen/src/schema.ts(zod definitions + docs metadata)config-gen/src/generate.ts(writes root schema files)iconmatelocal.schema.json(generated, committed)iconmateglobal.schema.json(generated, committed)
- README should include:
- local config filename and key meanings
- global config purpose and location conventions
svg_view_cmdtoken usage (%filename%)- defaults for macOS/Linux/Windows behavior
- note that
oopens local and Iconify preview SVGs
- Add
config-genscaffolding with Zod v4. - Define local/global schemas and TS types.
- Generate and commit root schema files.
- Load local/global config at app startup and apply precedence.
- Implement
oopen flow for local and Iconify search entries. - Add docs and tests.
- Local config supports
folder,preset,output_line_template, andsvg_view_cmd. - Global config supports
svg_view_cmd. - Root schema files are generated from Zod schemas.
oworks for local icons and Iconify search results.- Custom viewer command supports
%filename%substitution. - README clearly documents behavior and defaults.