-
Notifications
You must be signed in to change notification settings - Fork 0
feat: added 'list' command. #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| Review the iconmate skill definition at `skills/iconmate/SKILL.md` and verify it accurately reflects the current state of the CLI. | ||
|
|
||
| ## Steps | ||
|
|
||
| 1. Read `skills/iconmate/SKILL.md` in full. | ||
| 2. Run `iconmate --help` and `iconmate add --help`, `iconmate delete --help`, `iconmate list --help`, `iconmate iconify --help` to get the current CLI interface. | ||
| 3. Read the project `README.md` for any features or commands not covered in the skill. | ||
| 4. Read `Cargo.toml` for the current version number. | ||
| 5. Compare and report: | ||
| - **Missing commands**: CLI commands not documented in the skill. | ||
| - **Outdated flags**: Flags in the skill that no longer exist or have changed. | ||
| - **Wrong defaults**: Default values that don't match current behavior. | ||
| - **Version mismatch**: If the skill metadata version doesn't match `Cargo.toml`. | ||
| - **Missing features**: Significant capabilities described in the README but absent from the skill. | ||
| 6. Fix any issues found directly in `skills/iconmate/SKILL.md`. | ||
| 7. Print a summary of what was checked and any changes made. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,3 +14,6 @@ tag: tag_and_release | |
|
|
||
| tag_and_release: | ||
| sh tag_and_release.sh | ||
|
|
||
| sync_readme: | ||
| cp README.md npm/README.md | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| --- | ||
| name: iconmate | ||
| description: >- | ||
| Use when the user asks to add, search, list, or manage SVG icons in a JS/TS project. | ||
| Trigger phrases: "add an icon", "search for icons", "find an icon", "add svg", | ||
| "icon for heart", "list icons", "delete icon", "rename icon", "iconmate", "iconify". | ||
| metadata: | ||
| author: blankeos | ||
| version: "1.1.0" | ||
| repository: https://github.com/Blankeos/iconmate | ||
| license: MIT | ||
| --- | ||
|
|
||
| # iconmate | ||
|
|
||
| Add SVG icons to JS/TS projects without icon libraries. Uses Iconify's 200k+ icons or any SVG source. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| `iconmate` must be installed. If not available, install with any of these methods: | ||
|
|
||
| ```bash | ||
| # npm / pnpm / bun (prebuilt binary via npm) | ||
| npm install -g iconmate | ||
| pnpm add -g iconmate | ||
| bun add -g iconmate | ||
|
|
||
| # Run without installing | ||
| npx iconmate | ||
| pnpm dlx iconmate | ||
| bunx iconmate | ||
|
|
||
| # Cargo (build from source) | ||
| cargo install iconmate | ||
|
|
||
| # Cargo binstall (prebuilt binary via cargo) | ||
| cargo binstall iconmate | ||
| ``` | ||
|
|
||
| ## Workflow | ||
|
|
||
| Follow these steps when the user wants to add icons: | ||
|
|
||
| ### 1. Search for icons | ||
|
|
||
| ```bash | ||
| iconmate iconify search <query> --format json --limit 20 --include-collections | ||
| ``` | ||
|
|
||
| Present results to the user and let them pick. | ||
|
|
||
| ### 2. Add the icon | ||
|
|
||
| ```bash | ||
| iconmate add --folder <folder> --icon <prefix:name> --name <PascalCaseName> | ||
| ``` | ||
|
|
||
| - `--folder`: Icon output directory (default: `src/assets/icons`). Check `iconmate.config.json` or `iconmate.config.jsonc` in the project root for a configured folder. | ||
| - `--icon`: Accepts an Iconify name (e.g. `mdi:heart`), a URL, or raw SVG markup. | ||
| - `--name`: PascalCase alias used in the export (e.g. `Heart`). | ||
| - `--preset`: Framework preset. Check config for the project default. | ||
| - `normal` → `.svg` (plain SVG file) | ||
| - `react` → `.tsx` (React component) | ||
| - `svelte` → `.svelte` (Svelte component) | ||
| - `solid` → `.tsx` (SolidJS component) | ||
| - `vue` → `.vue` (Vue component) | ||
| - `emptysvg` → `.svg` (empty placeholder SVG) | ||
|
|
||
| ### 3. Verify | ||
|
|
||
| ```bash | ||
| iconmate list --folder <folder> | ||
| ``` | ||
|
|
||
| Confirm the icon appears in the list and the `index.ts` export file is updated. | ||
|
|
||
| ## Other Commands | ||
|
|
||
| ### Delete an icon | ||
|
|
||
| ```bash | ||
| iconmate delete --folder <folder> | ||
| ``` | ||
|
|
||
| ### List current icons | ||
|
|
||
| ```bash | ||
| iconmate list | ||
| ``` | ||
|
|
||
| ### Browse Iconify collections | ||
|
|
||
| ```bash | ||
| # List all collections | ||
| iconmate iconify collections | ||
|
|
||
| # List icons in a collection | ||
| iconmate iconify collection mdi | ||
|
|
||
| # Get raw SVG for one icon | ||
| iconmate iconify get mdi:heart | ||
| ``` | ||
|
|
||
| ### Add from URL or raw SVG | ||
|
|
||
| ```bash | ||
| # From URL | ||
| iconmate add --folder src/assets/icons --icon https://api.iconify.design/mdi:heart.svg --name Heart | ||
|
|
||
| # From raw SVG | ||
| iconmate add --folder src/assets/icons --icon '<svg>...</svg>' --name Heart | ||
| ``` | ||
|
|
||
| ### Custom export template | ||
|
|
||
| ```bash | ||
| iconmate add --folder src/assets/icons --icon mdi:heart --name Heart \ | ||
| --output-line-template "export { ReactComponent as Icon%name% } from './%icon%.svg?react';" | ||
| ``` | ||
|
|
||
| Template variables: `%name%` (PascalCase alias), `%icon%` (filename without extension), `%ext%` (file extension). | ||
|
|
||
| ## Configuration | ||
|
|
||
| Check for `iconmate.config.json` or `iconmate.config.jsonc` in the project root. If present, respect its `folder`, `preset`, and `output_line_template` values. CLI flags override config values. | ||
|
|
||
| ## Tips | ||
|
|
||
| - Always use `--format json` when searching so you can parse results programmatically. | ||
| - When adding multiple icons, run each `iconmate add` command separately. The export index is updated automatically after each add. | ||
| - For prototyping, use `--preset emptysvg` to create placeholder icons. | ||
| - The user imports icons like: `import { IconHeart } from "@/assets/icons";` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list command always falls back to
config::DEFAULT_FOLDERwhen no--folderflag is passed, and it never consults the project config loader (e.g.,iconmate.config.json) that the rest of the app uses for defaults. In projects that set a non-default folder in config,iconmate listwill look insrc/assets/iconsand print “No icons found” even though icons exist in the configured folder unless users remember to pass--folderevery time. This makes the new command inconsistent with configured defaults and will confuse users who rely on config.Useful? React with 👍 / 👎.