Skip to content

Getting started

The unofficial Iconify CLI lets you search, preview, and download icons from the Iconify API right from your terminal. It supports multiple output formats (SVG, JS, Vue, etc.), automatic metadata headers, and flexible file placement/naming strategies.

🧾 Table of Contents

🧩 Installation

You can install the CLI globally or use it directly via npx:

shell
# Using npx (recommended for one-time use)
npx iconify-cli@latest <command>

# Or install globally
npm install -g iconify-cli

⚙️ Configuration

Before downloading icons, initialize a configuration file. Run this in any project directory:

shell
iconify config init

This creates a file named .iconify in your current directory.

It is recommended but not required, to initialize a configuration file. If a configuration file is not initialized, default settings will be used wherever applicable and required options must be passed directly as CLI flag.

Example .iconify file

ini
[api]
; The Iconify API host. Default is 'api.iconify.design'
; host = api.iconify.design

; The API port to connect to. Default is 443.
; port = 443

[output]
; Directory where downloaded icons will be saved
; Path is relative to the config file. Default is '$CWD'
; out_dir =

; Determines folder structure:
; - 'flat' all icons are stored in the configured folder
; - 'prefixed' like 'flat' but the filenames have their collection prefix in front
; - 'grouped' a subfolder for each collection's prefix is generated
; placement =

; Filename strategy for downloaded icons:
; - 'lower' Strategy for lowercase
; - 'upper' Strategy for UPPERCASE
; - 'camel' Strategy for camelCase
; - 'pascal' Strategy for PascalCase
; - 'kebab' Strategy for kebab-case
; naming =

; Template or output format:
; - 'svg' A raw svg file template
; - 'raw' A raw ESM JavaScript template
; - 'raw-ts' A raw ESM TypeScript template
; - 'vue' A Vue.js template
; template =

Explanation of fields

SectionKeyDescriptionDefault
[api]hostIconify API hostname.api.iconify.design
[api]portPort for API requests.443
[output]out_dirOutput directory for downloaded icons.$CWD
[output]placementPlacement strategy of the downloaded icons
[output]namingNaming strategy of the downloaded icons
[output]templateTemplate used to generate output

The CLI automatically searches for a .iconify config file in the current or parent directories, similar to how npm finds package.json.

🔍 Searching for Icons

Search for icons by keyword:

shell
iconify search home

Output example:

text
[Fetch]: Fetch /search
[Info]: Found 999 icons for 'home'

material-symbols:home        material-symbols:home-outline        material-symbols:home-outline-rounded        material-symbols:home-rounded      
material-symbols-light:home  material-symbols-light:home-outline  material-symbols-light:home-outline-rounded  material-symbols-light:home-rounded
ic:baseline-home             ic:outline-home                      ic:round-home                                ic:sharp-home                      
...                          ...                                  ...                                          ...

You can also filter for a specific collection.

shell
iconify search home -p mdi

Output example:

text
[Fetch]: Fetch /search
[Info]: Found 76 icons for 'home'

mdi:home       mdi:home-outline       mdi:home-off           mdi:home-off-outline       
mdi:home-city  mdi:home-city-outline  mdi:home-edit          mdi:home-edit-outline      
mdi:home-lock  mdi:home-plus          mdi:home-plus-outline  mdi:home-roof             
...            ...                    ...                    ...

⬇️ Downloading Icons

Once you know the icon name (e.g., mdi:home), download it using:

shell
iconify download mdi:home

By default, this will:

  • Fetch the icon from the Iconify API.
  • Generate a file using your selected template.
  • Add a comment header containing metadata:
    • Icon name and collection
    • License
    • Version (if available)
    • Author
    • Download time

Example output file (for template raw):

javascript
/*
 * This file was downloaded via the unofficial Iconify CLI v1.0.0
 * 
 * Icon: mdi:home
 * Collection: Material Design Icons
 * License: Apache 2.0 (Apache-2.0)
 * Version: N/A
 * Author: Pictogrammers (https://github.com/Templarian/MaterialDesign)
 * Downloaded: 2025-10-26T14:48:19.373Z
 */

const icon = `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8z"/></svg>`;
export default icon;

Downloading multiple icons

It is possible to download multiple icons at once:

shell
iconify download mdi:home mdi:person

Also, downloading from different collections is fine:

shell
iconify download mdi:home mdi:person mdi-light:person

WARNING

The CLI doesn't check for the local existence of an icon.

When running following command with the flat placement strategy, the second Icon will override the first one because they result to the same name.

shell
iconify download mdi:person mdi-light:person

The same result applies, when downloading separately.

shell
iconify download mdi:person
iconify download mdi-light:person

🧱 Output Structure

The output file placement depends on your placement and naming strategy.

Naming

InputStrategyOutput
mdi:person-outlinelowerpersonoutline
mdi:person-outlineupperPERSONOUTLINE
mdi:person-outlinecamelpersonOutline
mdi:person-outlinepascalPersonOutline
mdi:person-outlinekebabperson-outline

Placement

The placement strategies defines how the downloaded icons are stored in your output directory.

For the placement, the naming strategy pascal and the template raw is used.

InputStrategyOutput
mdi:person-outlineflat$OUT_DIR/PersonOutline.js
mdi:person-outlineprefixed$OUT_DIR/MdiPersonOutline.js
mdi:person-outlinegrouped$OUT_DIR/mdi/PersonOutline.js

INFO

grouped is the recommendation when working with multiple icons sets.

When running the following command:

shell
iconify download mdi:person mdi:person-outline mdi:home mdi-light:person mdi-light:alert -t raw -p grouped -n pascal

iconify will generate the following folder structure:

text
$OUT_DIR
├── mdi
│   ├── Person.js
│   ├── PersonOutline.js
│   └── Home.js
└── mdi-light
    ├── Alert.js
    └── Person.js

🧪 Precedence of options

The order of options is simple: CLI flags have the highest priority and will override everything else. Next, the settings in the configuration file are applied. If an option isn't provided in either of these, it will fall back to the default values, if they exist. If no default exists, the value must either be passed as a CLI flag or defined in the settings file to make the command work.

🧾 Templates

svg

Downloads the icon as a raw svg file

txt
<!--
{0}
-->
{1}

raw

Downloads the icon as a raw ESM JavaScript module

js
/*
{0}
 */

const icon = `{1}`;
export default icon;

raw-ts

Downloads the icon as a raw ESM TypeScript module

ts
/*
{0}
 */

const icon: string = `{1}`;
export default icon;

vue

Downloads the icon as a Vue.js component

vue
<!--
{0}
-->
<template>
    {1}
</template>

Missing a template?

If you miss a template, feel free to open an issue or directly submit a PR with the new template