A terminal-based utility to interface with Nerd Fonts. This tool can emulate interactions that would normally occur on the official Nerd Fonts website directly from a shell. Search over 10,000 glyphs by name, keyword, glob, or regex, view actual glyph characters, retrieve raw codepoint data, locate or download fonts, track installed fonts, query font information, and more.
- See also: Official Nerd Fonts project
Nerd Fonts patches developer targeted fonts with a high number of glyphs (icons). Specifically to add a high number of extra glyphs from popular ‘iconic fonts’ such as Font Awesome, Devicons, Octicons, and others.
- Why this exists
- Requirements
- Installation
- Usage
- Options
- Examples
- Output formats
- Glyph categories
- Data files and updates
- License
Nerd Fonts is an incredible project that patches developer-focused fonts to include thousands of icons and glyphs from Font Awesome, Material Design, Codicons, Octicons, Devicons, and many more. If you spend any time configuring a shell prompt, a status bar, a Neovim setup, or anything else that lives in a terminal, you've almost certainly encountered or used their work.
Their official cheat sheet is outstanding, but requires a browser for normal use. This unofficial tool provides several alternative options for programmatically interacting with Nerd Fonts directly from the command line, in a unified way. Some of the core operational features currently include a CLI implementation of the aformentioned cheat sheet that can be used for general glyph searching, and a font management component that allows for downloading, tracking, and querying font information.
- The long-term goal of this project will be to add in and port more useful CLI capabilities and desirable features over.
If you find this tool useful, please check out and support the official Nerd Fonts project:
- Website: https://www.nerdfonts.com/
- GitHub: https://github.com/ryanoasis/nerd-fonts
- Cheat sheet: https://www.nerdfonts.com/cheat-sheet
They do great work, and the project is community-driven. I highly recommend you give them a star and donation before you do for this project, because this project wouldn't exist without theirs.
- Python 3.8+
- One or more Nerd Fonts installed
Nerd Fonts can either be downloaded from the official website here: Nerd Fonts Downloads or downloaded using this tool. See the section downloading fonts for instructions on how to use this tool to download fonts immediately.
Note:
When no Nerd Font is installed or set, the terminal will likely display random or null unicode characters. Make sure to install your preferred Nerd Font prior to using this utility or via download from the official Nerd Fonts website.
Currently, no external Python depenencies are required for installing and executing this program, but this is subject to change in future updates or implementations.
git clone https://github.com/jam-ware/nerd-fonts-cli.git
cd nerd-fonts-cli
pip install .This installs the following command aliases: nerd-fonts-cli, and nfcli. All are equivalent and provided for user preference. After installing, fetch the latest glyph data (requires an internet connection):
nerd-fonts-cli search --update./scripts/install.sh-
This method copies the package to
~/.local/lib/and creates wrapper scripts in~/.local/bin/. -
Run
./scripts/install.sh --helpfor options, or./scripts/install.sh --uninstallto remove.
To install the program specifically for development or testing purposes (where changes to the source take effect immediately without reinstalling), enter the command:
pip install -e .| Subcommand | Description |
|---|---|
search |
Search and display Nerd Fonts glyphs by keyword, glob, or regex |
fonts |
List, inspect, and install Nerd Fonts from the official GitHub release |
# Standard syntax
nerd-fonts-cli <subcommand> [options]
# View the general program help menu
nerd-fonts-cli --help
# View the current program version
nerd-fonts-cli --version
# Retrieve a context-specific help menu for subcommands
nerd-fonts-cli <subcommand> --helpSearch / filter:
| Flag | Description |
|---|---|
KEYWORD ... |
Keyword(s), substrings, globs (*, ?), or regex patterns (OR logic) |
-c CAT, --category CAT |
Filter to a glyph category (e.g. fa, cod, md); see --list-categories |
--sort KEY |
Sort results: name (alphabetical) or code (by codepoint value) |
Output mode (mutually exclusive):
| Flag | Description |
|---|---|
--json |
JSON object {"name": "hex_codepoint"} |
--csv |
CSV rows: name, codepoint, glyph |
--yaml |
YAML flat pairs: name: codepoint |
--count |
Print match count only (always exits 0 — useful in scripts) |
Text display (when no output mode flag is set):
| Flag | Description |
|---|---|
-f auto |
Colored output with all fields (default) |
-f some |
Compact output, no color |
-f none |
Raw glyph character only (pipe-safe, scriptable) |
Informational:
| Flag | Description |
|---|---|
--list-categories |
Show all glyph categories with glyph counts |
--data-info |
Show data file path, Nerd Fonts version, and glyph count |
--update |
Fetch latest glyph data from the Nerd Fonts GitHub release |
--force |
With --update: re-download even if already at latest version |
--data FILE |
Use an alternate glyphs.json data file |
| Subcommand | Description |
|---|---|
fonts list |
List all available Nerd Font families from the latest GitHub release |
fonts info NAME |
Show details for a specific font (size, version, install status) |
fonts install NAME |
Download and install a Nerd Font to the system fonts directory |
Shared flags (list, info, install):
| Flag | Description |
|---|---|
--json |
Output as JSON |
--csv |
Output as CSV |
--yaml |
Output as YAML |
Additional flags:
| Flag | Applies to | Description |
|---|---|---|
--refresh |
list, info |
Force re-fetch from GitHub, bypassing the 24-hour local cache |
--urls |
list |
Include download URLs in text output |
--force |
install |
Reinstall even if the font is already installed |
- Displaying and searching font glyphs
- Querying font information
- Downloading fonts
- Listing available fonts
# Search by keyword
nerd-fonts-cli search rocket
# Match multiple terms (OR logic)
nerd-fonts-cli search rocket fire flame
# Glob search for all Font Awesome glyphs
nerd-fonts-cli search "nf-fa-*"
# Glob search for 'rocket' keyword across all families
nerd-fonts-cli search "nf-*-rocket*"
# Regex pattern matching for the keyword 'arrow'
nerd-fonts-cli search "arrow.*(up|down)"
# Filter by specified category
nerd-fonts-cli search -c weather
# Combined keyword and category filter
nerd-fonts-cli search arrow -c fa
# List all categories with counts
nerd-fonts-cli search --list-categories
# Compact and colorless output
nerd-fonts-cli search tree -f some
# Display raw glyphs only (one per line)
nerd-fonts-cli search rocket -f none
# Count matches for the keyword search 'arrow'
nerd-fonts-cli search arrow -c fa --count
# Sort keyword search results alphabetically
nerd-fonts-cli search arrow --sort name
# Display keyword search output in CSV format
nerd-fonts-cli search git --csv
# Display keyword search output in YAML format
nerd-fonts-cli search git --yaml
# Display keyword search output in JSON format
nerd-fonts-cli search git --json
# Show which data file is active and its version
nerd-fonts-cli search --data-info# List all available Nerd Fonts (from latest GitHub release)
nerd-fonts-cli fonts list
# List fonts and display output in JSON format
nerd-fonts-cli fonts list --json# Download and install a font
nerd-fonts-cli fonts install JetBrainsMono
# Reinstall a font (overwrite existing)
nerd-fonts-cli fonts install Hack --force# Show details for a specific font
nerd-fonts-cli fonts info JetBrainsMono
# Display font information output in JSON format
nerd-fonts-cli fonts info Hack --json
# Force re-fetch font list from GitHub before displaying font information
nerd-fonts-cli fonts info DejaVuSansM --refreshNote: The character
?represents a placeholder for the actual glyph for the following examples.
-f auto (DEFAULT) - colored output, one block per glyph;
Example:
name: nf-md-rocket
unicode: f0463
python: \U000f0463
glyph: ?
-f some - compact, colorless output;
Example:
nf-md-rocket
f0463
\U000f0463
?
-f none - raw glyph character only (one per line, pipe-safe);
Example:
?
--csv - Output data in CSV (spreadsheet compatible) format;
Example:
name,codepoint,glyph
nf-md-rocket,f0463,--yaml - Output data in YAML format;
Example:
nf-md-rocket: f0463
nf-md-rocket_launch: f14de--json - Output data in JSON format;
Example:
{
"nf-md-rocket": "f0463",
"nf-md-rocket_launch": "f14de"
}Run nerd-fonts-cli search --list-categories for a full table with counts. The main families currently include:
Filter (-c) |
Family | Glyphs |
|---|---|---|
cod |
Codicons (VS Code) | 438 |
fa |
Font Awesome | 1,817 |
fae |
Font Awesome Extension | 170 |
md |
Material Design Icons | 6,880 |
oct |
Octicons (GitHub) | 310 |
dev |
Devicons | 191 |
seti |
Seti UI | 167 |
weather |
Weather Icons | 228 |
linux |
Linux logos | 118 |
pl / ple |
Powerline | 43 |
custom |
Nerd Fonts custom | 36 |
The bundled data/glyphs.json is the default data source. Run search --update to fetch the latest release from the Nerd Fonts GitHub repository. Refreshed data is written to ~/.nerdfonts-search/glyphs.json and takes priority over the bundled file on all subsequent runs.
# Fetch latest Nerd Fonts glyph data
nerd-fonts-cli search --update
# Re-download even if already at the latest version
nerd-fonts-cli search --update --force
# Check which data file is active and its version
nerd-fonts-cli search --data-infoUpdated data is stored in ~/.nerdfonts-search/ (works on Linux and macOS).
The previous file is backed up as glyphs.json.bak before each overwrite.
Use search --data FILE to point at any custom {"name": "hex_codepoint"} JSON file.
MIT
Glyph data sourced from the official Nerd Fonts project (MIT License). Huge thanks to @ryanoasis and all the contributors who maintain it - this simple tool wouldn't exist without their work. Go check them out.
