### Example of Getting MCP Server Configuration Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/COMPLETION_REPORT.txt Demonstrates retrieving the configuration for the MCP server. ```typescript function getMcpServerConfig(agentName: string): McpServerConfig | undefined { // Implementation to get MCP server config return undefined; } ``` -------------------------------- ### Setup Better Icons CLI Source: https://github.com/better-auth/better-icons/blob/main/README.md Run the 'setup' command to configure the tool. An interactive wizard is available, or use '-y' for auto-confirmation. Setup can be scoped to the current project using '-s project'. ```bash better-icons setup ``` ```bash better-icons setup -y ``` ```bash better-icons setup -s project ``` -------------------------------- ### Recommend Icons Command Examples Source: https://github.com/better-auth/better-icons/blob/main/README.md Use the `recommend_icons` tool to get suggestions for icons based on a use case and desired style. ```shell What icon should I use for a settings button? ``` ```shell Recommend icons for user authentication ``` -------------------------------- ### Setup with Skip Prompts Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md Executes the setup command non-interactively by skipping all confirmation prompts and auto-detecting agents. Useful for automated setups. ```bash npx better-icons setup -y ``` -------------------------------- ### Example of Getting Agent Configurations Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/COMPLETION_REPORT.txt Demonstrates how to retrieve agent configurations, potentially merging default and user-defined settings. ```typescript async function getAgentConfigs(agentName: string): Promise { // Implementation to fetch and merge configurations return []; } ``` -------------------------------- ### Better Icons CLI Examples Source: https://github.com/better-auth/better-icons/blob/main/skills/SKILL.md Practical examples demonstrating how to use `better-icons` for searching, retrieving, and batch downloading icons. ```bash better-icons search arrow --limit 10 better-icons search home --json | jq '.icons[0]' better-icons get lucide:home > icon.svg better-icons get mdi:home --color '#333' --json # Batch download all search results better-icons search arrow -d # saves to ./icons/ better-icons search check -d ./my-icons # saves to ./my-icons/ better-icons search star -d -c '#000' -s 24 --limit 64 ``` -------------------------------- ### Example of Getting Open Code MCP Configuration Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/COMPLETION_REPORT.txt Illustrates how to retrieve the MCP configuration for open code scenarios. ```typescript function getOpenCodeMcpConfig(agentName: string): any | undefined { // Implementation to get open code MCP config return undefined; } ``` -------------------------------- ### Setup with Specific Agents Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md Installs the MCP server configuration for only the specified agents. Use this to customize which agents are enabled. ```bash npx better-icons setup -a cursor opencode ``` -------------------------------- ### MCP Example for get_icon_preferences Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/mcp-tools.md Example prompts for retrieving icon preferences using the MCP. ```text Show my icon preferences Parameters: {} ``` ```text What icon collections do I use most? Parameters: {} ``` -------------------------------- ### Setup with Skip Confirmation and Specific Agents Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md Runs the setup command non-interactively, skipping confirmation prompts while allowing the selection of specific agents. This provides a balance between automation and customization. ```bash npx better-icons setup --yes --agent cursor --agent claude-code ``` -------------------------------- ### Better Icons CLI - Download Output Example Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md This example demonstrates the output after successfully downloading icons. It confirms the number of icons downloaded and the directory where they were saved. ```text Downloading 32 icons to ./icons... ✓ lucide:arrow ✓ lucide:arrow-right ✓ lucide:arrow-down ... 32 saved ``` -------------------------------- ### Install Better Icons CLI Globally (Bun) Source: https://github.com/better-auth/better-icons/blob/main/README.md Install the better-icons CLI globally using Bun for faster installation. This is an alternative to npm for direct use outside of an agent environment. ```bash # Using Bun (faster) bun add -g better-icons ``` -------------------------------- ### Sync Icon to Project Command Examples Source: https://github.com/better-auth/better-icons/blob/main/README.md Use the `sync_icon` tool to get an icon and automatically add it to your project's icons file. Specify the icons file path and framework. ```shell Sync the lucide:home icon to my project ``` ```shell Add a settings icon to my icons file ``` -------------------------------- ### Install Dependencies with Bun Source: https://github.com/better-auth/better-icons/blob/main/README.md Use this command to install all necessary project dependencies using Bun. ```bash bun install ``` -------------------------------- ### MCP Example for clear_icon_preferences Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/mcp-tools.md Example prompts for clearing icon preferences using the MCP. ```text Clear my icon preferences Parameters: {} ``` ```text Reset icon preferences Parameters: {} ``` -------------------------------- ### AgentConfig Example Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/types.md An example of how to instantiate the AgentConfig interface. Ensure all fields are populated according to the interface definition. ```javascript const agentConfig: AgentConfig = { name: "cursor", displayName: "Cursor", configPath: "/Users/user/.cursor/mcp.json", projectConfigPath: "/path/to/project/.cursor/mcp.json", detected: true }; ``` -------------------------------- ### Get Recent Icons Command Examples Source: https://github.com/better-auth/better-icons/blob/main/README.md Use the `get_recent_icons` tool to quickly access your recently used icons. ```shell Show my recent icons ``` ```shell What icons have I used recently? ``` -------------------------------- ### Get Multiple Icons (Batch Retrieval) Command Examples Source: https://github.com/better-auth/better-icons/blob/main/README.md Use the `get_icons` tool for efficient batch retrieval of multiple icons. Specify color and size for all icons. ```shell Get these icons: lucide:home, lucide:settings, lucide:user ``` -------------------------------- ### Get Icon Preferences Command Examples Source: https://github.com/better-auth/better-icons/blob/main/README.md Use the `get_icon_preferences` tool to view your learned icon collection preferences and usage statistics. ```shell Show my icon preferences ``` ```shell What icon collections do I use most? ``` -------------------------------- ### Run Development Server with Bun Source: https://github.com/better-auth/better-icons/blob/main/README.md Execute this command to start the local development server. ```bash bun run dev ``` -------------------------------- ### Example of Getting Claude Code Config Path Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/COMPLETION_REPORT.txt Illustrates how to determine the configuration file path for Claude Code. ```typescript function getClaudeCodeConfigPath(agentName: string): string { // Implementation to find the config path return "/path/to/config"; } ``` -------------------------------- ### Better Icons CLI - Regular Output Example Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md This example shows the typical output when searching for icons without the download option. It lists found icons with clickable preview links and indicates the total and displayed counts. ```text Found 150 icons (showing 32): lucide:arrow [→] lucide:arrow-right [→] lucide:arrow-down [→] ... Use -d to download all: better-icons search "arrow" -d ``` -------------------------------- ### Setup with Project Scope Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md Configures better-icons specifically for the current project directory. This limits the configuration to the local project. ```bash npx better-icons setup -s project ``` -------------------------------- ### MCP Example for find_similar_icons Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/mcp-tools.md Example prompts for finding similar icons using the MCP, specifying icon ID and an optional limit. ```text Find icons similar to lucide:home Parameters: {icon_id: "lucide:home"} ``` ```text What other arrow icons are there like mdi:arrow-right? Parameters: {icon_id: "mdi:arrow-right", limit: 20} ``` -------------------------------- ### Install better-icons Globally Source: https://github.com/better-auth/better-icons/blob/main/skills/SKILL.md Install the better-icons tool globally using npm or Bun for easy access to all commands. ```bash # Using npm npm install -g better-icons # Using Bun (faster) bun add -g better-icons ``` -------------------------------- ### Install Better Icons CLI Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/api-overview.md These commands show how to install the Better Icons command-line interface globally or execute it directly using npx. ```bash npm install -g better-icons ``` ```bash bun add -g better-icons ``` ```bash npx better-icons ``` -------------------------------- ### Setup with Project Scope and Skip Prompts Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md Automatically sets up better-icons for the current project, skipping all confirmation prompts. This is a streamlined way to configure project-specific settings. ```bash npx better-icons setup -s project -y ``` -------------------------------- ### Get Icon Command Examples Source: https://github.com/better-auth/better-icons/blob/main/README.md Use the `get_icon` tool to retrieve SVG code, URLs, or components for a specific icon. Specify color and size as needed. ```shell Get the SVG for mdi:home ``` ```shell Get a URL for mdi:home ``` ```shell Get lucide:arrow-right with size 24 ``` -------------------------------- ### Start MCP Server Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/INDEX.md Use this snippet to start the MCP server. It registers all available tools and uses stdio transport. ```typescript import { runServer } from './server.js'; await runServer(); ``` -------------------------------- ### Setup Command Signature Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md Defines the signature for the 'setup' command, indicating it accepts options. Use this to configure the MCP server for AI coding agents. ```bash better-icons setup [options] ``` -------------------------------- ### Automated MCP Setup for CI/CD Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md Performs an automated setup for the MCP server, suitable for continuous integration and continuous deployment environments. It uses flags for non-interactive setup, global scope, and specific agent configuration. ```bash npx better-icons setup -y -s global -a cursor ``` -------------------------------- ### Example SVG Return Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/icon-utilities.md An example of a complete SVG string generated by the `buildSvg` function, ready for embedding. ```svg ``` -------------------------------- ### Default Action: Start MCP Server Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md When no command is specified, the server runs automatically, equivalent to 'better-icons serve'. It starts the MCP server on stdin/stdout. ```bash better-icons # Equivalent to: better-icons serve # Starts MCP server on stdin/stdout ``` -------------------------------- ### Example React Icon File Structure Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/project-sync.md This example demonstrates the expected structure of a React icon file after adding two new icons. It includes the auto-generated header, necessary imports, and individual icon components with source comments. ```typescript // Auto-generated icons file - managed by better-icons // Do not edit manually - use sync_icon to add new icons import type React from "react"; // lucide:home export const HomeIcon = (props: React.SVGProps) => ( ); // lucide:settings export const SettingsIcon = (props: React.SVGProps) => ( ); ``` -------------------------------- ### Install Better Icons CLI Globally (npm) Source: https://github.com/better-auth/better-icons/blob/main/README.md Install the better-icons CLI globally using npm for direct use outside of an agent environment. ```bash # Using npm npm install -g better-icons ``` -------------------------------- ### IconSet Example Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/types.md An example illustrating the creation of an IconSet object, including defining default dimensions, icons, and an alias. This structure is key for organizing and accessing multiple icons. ```javascript const iconSet: IconSet = { width: 24, height: 24, icons: { 'home': { body: '', width: 24, height: 24 }, 'house': { parent: 'home' } // alias }, aliases: { 'house': { parent: 'home' } } }; ``` -------------------------------- ### Example Preferences File Content Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/types.md Illustrates the expected JSON format for the preferences file, showing sample data for collection usage and icon history. ```json { "collections": { "lucide": { "count": 15, "lastUsed": "2025-02-15T10:30:00.000Z" }, "mdi": { "count": 8, "lastUsed": "2025-02-15T09:15:00.000Z" } }, "history": [ { "iconId": "lucide:home", "timestamp": "2025-02-15T10:30:00.000Z" }, { "iconId": "lucide:settings", "timestamp": "2025-02-15T10:29:00.000Z" } ] } ``` -------------------------------- ### Run better-icons without Installation Source: https://github.com/better-auth/better-icons/blob/main/skills/SKILL.md Execute better-icons commands without a global installation by prefixing commands with `npx` (npm) or `bunx` (Bun). ```bash # Using npx (npm) npx better-icons search arrow --limit 10 npx better-icons get lucide:home > icon.svg # Using bunx (Bun — faster) bunx better-icons search arrow --limit 10 bunx better-icons get lucide:home > icon.svg ``` -------------------------------- ### Cursor Manual Installation Configuration Source: https://github.com/better-auth/better-icons/blob/main/README.md Add this configuration to your ~/.cursor/mcp.json file to enable the better-icons MCP server. ```json { "mcpServers": { "better-icons": { "command": "npx", "args": ["-y", "better-icons"] } } } ``` -------------------------------- ### Search Icons Command Examples Source: https://github.com/better-auth/better-icons/blob/main/README.md Use the `search_icons` tool to find icons by query and optionally filter by collection. ```shell Search for "arrow" icons ``` ```shell Search for "home" icons in the lucide collection ``` -------------------------------- ### Claude Native Installer Config Path Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/agent-configuration.md This is the configuration file path for the native installer of Claude. ```bash ~/.claude.json (single file) ``` -------------------------------- ### CollectionUsage Example Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/types.md Illustrates how to create an object conforming to the CollectionUsage interface. ```javascript const usage: CollectionUsage = { count: 42, lastUsed: "2025-02-15T10:30:00.000Z" }; ``` -------------------------------- ### Run better-icons config command Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md Use this command to display manual configuration instructions and file locations for agents. It's helpful for troubleshooting or when interactive setup is unavailable. ```bash npx better-icons config ``` -------------------------------- ### IconData Example Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/types.md An example demonstrating how to define an IconData object with an SVG path and dimensions. This structure is essential for representing icon components. ```javascript const iconData: IconData = { body: '', width: 24, height: 24 }; ``` -------------------------------- ### OpenCode Configuration File Format Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/api-overview.md Example of the OpenCode configuration file format for Better Icons, detailing its local execution command and enablement status. ```json { "mcp": { "better-icons": { "type": "local", "command": ["npx", "-y", "better-icons"], "enabled": true } } } ``` -------------------------------- ### Example of Generated Icon File Content Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/project-sync.md This is an example of how the icons file might look after a new icon has been added using `addIconToFile`. It includes necessary imports and the exported icon component. ```typescript // Auto-generated icons file - managed by better-icons // Do not edit manually - use sync_icon to add new icons import type React from "react"; // lucide:home export const HomeIcon = (props: React.SVGProps) => ( ); ``` -------------------------------- ### List Collections Command Examples Source: https://github.com/better-auth/better-icons/blob/main/README.md Use the `list_collections` tool to view all available icon collections or search for specific ones by name. ```shell List all icon collections ``` ```shell Search for "material" collections ``` -------------------------------- ### IconHistoryEntry Example Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/types.md Demonstrates the creation of an IconHistoryEntry object with a specific icon ID and timestamp. ```javascript const entry: IconHistoryEntry = { iconId: "lucide:arrow-right", timestamp: "2025-02-15T10:30:00.000Z" }; ``` -------------------------------- ### Execute Better Icons CLI with npx Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md If global installation fails or causes issues, try executing the Better Icons CLI using npx. This can resolve 'CLI not found' errors by running the package without global installation. ```bash npx better-icons ``` -------------------------------- ### Find Similar Icons Command Examples Source: https://github.com/better-auth/better-icons/blob/main/README.md Use the `find_similar_icons` tool to discover variations of a given icon across different collections. ```shell Find icons similar to lucide:home ``` ```shell What other arrow icons are there like mdi:arrow-right? ``` -------------------------------- ### InstallResult TypeScript Interface Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/types.md Defines the structure for the result of an MCP server installation for a single agent. Use this to track installation success, failure, and associated paths. ```typescript export interface InstallResult { agent: string; success: boolean; path: string; error?: string; } ``` -------------------------------- ### Better Icons CLI Commands Source: https://github.com/better-auth/better-icons/blob/main/skills/SKILL.md Overview of available `better-icons` CLI commands for searching, getting, and setting up the MCP server. ```bash # Search icons better-icons search [--prefix ] [--limit ] [--json] # Search and download all found icons as SVG files better-icons search -d [dir] [--color ] [--size ] # Get icon SVG (outputs to stdout) better-icons get [--color ] [--size ] [--json] # Setup MCP server for AI agents better-icons setup [-a cursor,claude-code] [-s global|project] ``` -------------------------------- ### Scan Project Icons Command Examples Source: https://github.com/better-auth/better-icons/blob/main/README.md Use the `scan_project_icons` tool to check which icons are already present in your project's icons file. ```shell What icons are already in my project? ``` ```shell Scan my icons file ``` -------------------------------- ### Verify Global Installation of Better Icons CLI Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md Run this command to check if the Better Icons CLI is installed globally on your system. This helps diagnose 'CLI not found' errors. ```bash npm list -g better-icons ``` -------------------------------- ### ConfigScope Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/types.md Defines the scope for configuration installation, which can be either 'global' or 'project'. ```APIDOC ## ConfigScope ### Description Scope for configuration installation. ### Values - **"global"** (string) - User-level configuration, applies to all projects. Config Location: Home directory. - **"project"** (string) - Project-level configuration, applies only to current project. Config Location: Current working directory. ``` -------------------------------- ### Example Usage of generateIconComponent Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/project-sync.md Demonstrates how to use the generateIconComponent function to create icon components for React and Vue. ```typescript const svg = ''; const react = generateIconComponent("HomeIcon", svg, "lucide:home", "react"); // Returns React component code const vue = generateIconComponent("HomeIcon", svg, "lucide:home", "vue"); // Returns Vue component code ``` -------------------------------- ### sync_icon Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/mcp-tools.md Get an icon and automatically add it to the project's icons file. This is the recommended way to add icons. ```APIDOC ## sync_icon ### Description Get an icon AND automatically add it to the project's icons file. The recommended way to add icons. ### Method `sync_icon` (Tool) ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * **icons_file** (string) - Required - Absolute path to the icons file * **framework** (string) - Required - Framework for icon components. Allowed values: "react", "vue", "svelte", "solid", "svg" * **icon_id** (string) - Required - Icon identifier in format 'prefix:name' (e.g., 'lucide:home') * **component_name** (string) - Optional - Custom component name (auto-generated from icon name if not provided) * **color** (string) - Optional - Icon color (e.g., 'currentColor') * **size** (number) - Optional - Icon size in pixels ### Request Example ```json { "icons_file": "/Users/me/myapp/src/icons.tsx", "framework": "react", "icon_id": "lucide:home" } ``` ### Response #### Success Response (TextContent[]) Returns text content containing: - If new icon added: - Confirmation of icon addition - File path - Import statement - Usage example - If icon already exists: - Message that icon already exists with component name - Import statement - Usage example #### Response Example ```json [ { "content": "Icon 'lucide:home' added to /Users/me/myapp/src/icons.tsx. Import it as HomeIcon. Usage: " } ] ``` ### Error Handling * **Invalid icon ID**: Triggered by missing colon or improper structure in `icon_id`. * **HTTP error**: Triggered if an API request fails. * **Invalid API response format**: Triggered by an unexpected API response. * **Icon '[id]' not found**: Triggered if the icon name is not found in the collection. ``` -------------------------------- ### recommend_icons Source: https://github.com/better-auth/better-icons/blob/main/README.md Get icon recommendations for a specific use case. You can specify style and limit. ```APIDOC ## recommend_icons ### Description Get icon recommendations for a specific use case. ### Parameters #### Query Parameters - **use_case** (string) - Required - Describe what you need - **style** (string) - Optional - 'solid', 'outline', or 'any' - **limit** (integer) - Optional - Number of recommendations (1-20) ``` -------------------------------- ### Raw SVG Output Example Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md This is the default output format when retrieving an icon, providing the raw SVG markup. ```svg ``` -------------------------------- ### Clear Icon Preferences Command Examples Source: https://github.com/better-auth/better-icons/blob/main/README.md Use the `clear_icon_preferences` tool to reset all learned icon preferences. ```shell Clear my icon preferences ``` ```shell Reset icon preferences ``` -------------------------------- ### sync_icon Source: https://github.com/better-auth/better-icons/blob/main/README.md Get an icon AND automatically add it to your project's icons file. The recommended way to add icons. Supports custom component names, color, and size. ```APIDOC ## sync_icon ### Description Get an icon AND automatically add it to your project's icons file. The recommended way to add icons. ### Parameters #### Query Parameters - **icons_file** (string) - Required - Absolute path to the icons file - **framework** (string) - Required - 'react', 'vue', 'svelte', 'solid', or 'svg' - **icon_id** (string) - Required - Icon ID in format 'prefix:name' - **component_name** (string) - Optional - Custom component name - **color** (string) - Optional - Icon color - **size** (integer) - Optional - Icon size in pixels ### Returns - Confirmation that icon was added (or already exists) - Import statement to use - Usage example ``` -------------------------------- ### Setup Specific MCP Agent Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md Configures the MCP server for a specific agent (e.g., 'claude-code') and scope (e.g., 'project'). ```bash npx better-icons setup -a claude-code -s project ``` -------------------------------- ### Display Better Icons Configuration Instructions Source: https://github.com/better-auth/better-icons/blob/main/README.md Use the 'config' command to view manual configuration instructions. ```bash better-icons config ``` -------------------------------- ### Get Claude Code Config Path Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/agent-configuration.md Retrieves the absolute path to the Claude Code configuration file. It prioritizes the native installer's `~/.claude.json` and falls back to the NPM version's `~/.claude/settings.json` if the native one is not found. This function does not create the file. ```typescript function getClaudeCodeConfigPath(home: string): string ``` -------------------------------- ### Build Project with Bun Source: https://github.com/better-auth/better-icons/blob/main/README.md Run this command to build the project for production. ```bash bun run build ``` -------------------------------- ### Basic Command Structure Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md Illustrates the general syntax for using the better-icons CLI. This is the entry point for all commands. ```bash better-icons [arguments] [options] ``` -------------------------------- ### Show Help Information Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md Displays help information for the Better Icons CLI. Use the long '--help' or short '-h' flag. ```bash npx better-icons --help ``` ```bash npx better-icons -h ``` -------------------------------- ### Show Version Information Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md Displays the version of the Better Icons CLI. Use the long '--version' or short '-v' flag. ```bash npx better-icons --version ``` ```bash npx better-icons -v ``` -------------------------------- ### getClaudeCodeConfigPath Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/COMPLETION_REPORT.txt Gets the configuration path for Claude Code. ```APIDOC ## getClaudeCodeConfigPath() ### Description Determines and returns the configuration file path specific to Claude Code. ### Returns - (string | null) - The path to the Claude Code configuration file, or null if not found. ``` -------------------------------- ### Get Specific Icon SVG with Better Icons CLI Source: https://github.com/better-auth/better-icons/blob/main/README.md Retrieve the SVG code for a specific icon using the 'get' command. You can specify color and size. The icon ID format is 'prefix:name'. Use '--json' for output with metadata. ```bash better-icons get [options] ``` -------------------------------- ### clear_icon_preferences Source: https://github.com/better-auth/better-icons/blob/main/README.md Reset all learned icon preferences to start fresh. ```APIDOC ## clear_icon_preferences ### Description Reset all learned icon preferences to start fresh. ``` -------------------------------- ### Get Icons Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/mcp-tools.md Retrieves a list of icons from a specified collection. ```APIDOC ## GET /{prefix}.json ### Description Retrieves a list of icons from a specified collection. ### Method GET ### Endpoint `/{prefix}.json?icons={name1},{name2}` ### Parameters #### Path Parameters - **prefix** (string) - Required - The icon collection prefix. #### Query Parameters - **icons** (string) - Required - A comma-separated list of icon names to retrieve. ``` -------------------------------- ### Initial State of Preferences Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/memory-preferences.md Represents the default empty state for icon usage preferences. ```json { "collections": {}, "history": [] } ``` -------------------------------- ### Complete Icon Retrieval Flow Example Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/icon-utilities.md Demonstrates the full process of fetching an icon set from an API, resolving aliases, extracting icon data, building an SVG with options, and outputting the result. Ensure the icon set is fetched correctly and alias resolution is handled. ```typescript // 1. Get icon set from API const iconSet = await fetch(`https://api.iconify.design/lucide.json?icons=home`); // 2. Resolve potential alias const resolvedName = resolveIconAlias(iconSet, "home"); // 3. Extract icon data const iconData = iconSet.icons[resolvedName]; // 4. Build SVG with options const svg = buildSvg( iconData, { width: iconSet.width, height: iconSet.height }, { size: 24, color: '#ff0000' } ); // 5. Return or save console.log(svg); ``` -------------------------------- ### Build Command - Better Icons Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/api-overview.md This command is used to build the Better Icons project using Bun. It specifies the input file, output directory, target environment, and minification. ```bash bun build ./src/index.ts --outdir dist --target node --minify ``` -------------------------------- ### Recommend Icons with Style and Limit Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/mcp-tools.md Use this snippet to recommend icons for a use case, specifying the desired style (e.g., 'solid') and the number of recommendations. The tool prioritizes collections based on the chosen style. ```mcp Recommend icons for user authentication (solid style) Parameters: {use_case: "user authentication", style: "solid", limit: 5} ``` -------------------------------- ### Recommend Icons for a Use Case Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/mcp-tools.md Use this snippet to get icon recommendations for a specific use case. The tool suggests icons based on the provided description and returns a list of icon IDs. ```mcp What icon should I use for a settings button? Parameters: {use_case: "settings button"} ``` -------------------------------- ### Example of Checking Claude Code Detection Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/COMPLETION_REPORT.txt Shows how to check if Claude Code is detected within the agent environment. ```typescript function isClaudeCodeDetected(agentName: string): boolean { // Implementation to check for Claude Code presence return false; } ``` -------------------------------- ### CLI Usage Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/INDEX.md The main entry point for the command-line interface is `src/index.ts`, which utilizes Commander.js for command parsing. ```bash better-icons [options] ``` -------------------------------- ### get_icons Source: https://github.com/better-auth/better-icons/blob/main/README.md Get multiple icons at once (batch retrieval). More efficient than multiple `get_icon` calls. Supports color and size. ```APIDOC ## get_icons ### Description Get multiple icons at once (batch retrieval). More efficient than multiple `get_icon` calls. ### Parameters #### Query Parameters - **icon_ids** (array) - Required - Array of icon IDs (max 20) - **color** (string) - Optional - Color for all icons - **size** (integer) - Optional - Size in pixels for all icons ``` -------------------------------- ### CLI Execution Flow Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/api-overview.md Illustrates the sequence of operations when executing Better Icons via the command-line interface. ```text better-icons command [args] [options] ↓ src/index.ts (Commander.js setup) ↓ Specific command handler ↓ Output to stdout/stderr ↓ Exit with status code ``` -------------------------------- ### isClaudeCodeDetected Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/agent-configuration.md Checks if Claude Code is installed, either in its native or NPM version, by verifying the existence of its configuration file or directory. ```APIDOC ## Function: isClaudeCodeDetected ### Description Check if Claude Code is installed (native or NPM version). ### Signature ```typescript function isClaudeCodeDetected(home: string): boolean ``` ### Parameters #### Path Parameters - **home** (string) - Yes - User home directory path ### Returns `true` if either native or NPM Claude Code is installed. ### Detection - Returns true if `~/.claude.json` exists - Or if `~/.claude` directory exists - False if neither exists ### Example ```typescript const home = homedir(); const isDetected = isClaudeCodeDetected(home); // true if Claude Code is installed, false otherwise ``` ``` -------------------------------- ### Project Sync Flow Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/api-overview.md Describes the workflow for synchronizing icons within a project, including fetching, parsing, and file generation. ```text User requests icon sync ↓ Get icon from Iconify ↓ parseExistingIcons() to check for duplicates ↓ iconIdToComponentName() or use custom name ↓ generateIconComponent() for framework ↓ addIconToFile() to write/update file ↓ getImportStatement() for usage ↓ Return confirmation to user ``` -------------------------------- ### JSON Output Example Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/cli-commands.md When the --json flag is used, the output includes the icon ID, SVG code, and dimensions. ```json { "id": "lucide:home", "svg": "...", "width": 24, "height": 24 } ``` -------------------------------- ### Sync Icon to Project (React) Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/mcp-tools.md Use this command to synchronize a 'lucide:home' icon to your React project's icons file. Ensure the icons_file path is correct. ```bash Sync the lucide:home icon to my project Parameters: { icons_file: "/Users/me/myapp/src/icons.tsx", framework: "react", icon_id: "lucide:home" } ``` -------------------------------- ### get_icon Source: https://github.com/better-auth/better-icons/blob/main/README.md Get the SVG code for a specific icon with multiple usage formats. Supports color, size, and format options. ```APIDOC ## get_icon ### Description Get the SVG code for a specific icon with multiple usage formats. ### Parameters #### Path Parameters - **icon_id** (string) - Required - Icon ID in format 'prefix:name' (e.g., 'mdi:home') #### Query Parameters - **color** (string) - Optional - Icon color (e.g., '#ff0000', 'currentColor') - **size** (integer) - Optional - Icon size in pixels - **format** (string) - Optional - 'svg' (default) or 'url' ### Returns - Raw SVG code - React/JSX component code - Iconify component usage - Direct SVG URL (when `format: "url"`) ``` -------------------------------- ### TypeScript Interfaces Source: https://github.com/better-auth/better-icons/blob/main/skills/SKILL.md TypeScript interfaces for programmatic interaction with Better Icons, defining the structure for search, get, and recommend operations. ```APIDOC ## TypeScript Interfaces ### SearchIcons Interface ```typescript interface SearchIcons { query: string limit?: number // 1-999, default 32 prefix?: string // e.g., 'mdi', 'lucide' category?: string // e.g., 'General', 'Emoji' } ``` ### GetIcon Interface ```typescript interface GetIcon { icon_id: string // 'prefix:name' format color?: string // e.g., '#ff0000', 'currentColor' size?: number // pixels } ``` ### GetIcons Interface ```typescript interface GetIcons { icon_ids: string[] // max 20 color?: string size?: number } ``` ### RecommendIcons Interface ```typescript interface RecommendIcons { use_case: string // e.g., 'navigation menu' style?: 'solid' | 'outline' | 'any' limit?: number // default 10 } ``` ### SyncIcon Interface ```typescript interface SyncIcon { icons_file: string // absolute path framework: 'react' | 'vue' | 'svelte' | 'solid' | 'svg' icon_id: string component_name?: string } ``` ``` -------------------------------- ### Search for Icons via CLI Source: https://github.com/better-auth/better-icons/blob/main/README.md Use the CLI to search for icons across 150+ collections. You can specify a search term and an optional limit or prefix. ```bash # 1. Search for icons (finds icons across 150+ collections) npx better-icons search arrow --limit 10 npx better-icons search home --prefix lucide ``` -------------------------------- ### Get Recent Icons (MCP) Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/mcp-tools.md Use this command to view a list of recently used icons. You can specify the number of icons to display. ```plaintext Show my recent icons Parameters: {} ``` ```plaintext What icons have I used recently? Parameters: {limit: 10} ``` -------------------------------- ### MCP Server Execution Flow Source: https://github.com/better-auth/better-icons/blob/main/_autodocs/api-overview.md Details the steps involved when Better Icons runs in an MCP server context, typically without a specific command. ```text npx better-icons (no command) ↓ src/index.ts detects MCP context ↓ runServer() from src/server.ts ↓ McpServer registers 10+ tools ↓ Connect to stdio transport ↓ Listen for tool calls ↓ Execute tool, return result ```