-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
A config file answers three questions: which release, which families, and where to put them.
release: latest
destination: ~/.local/share/fonts/NerdFonts
refresh_font_cache: true
families:
- JetBrainsMono
- Hack
- FiraCode| Key | Type | Required | Default | Meaning |
|---|---|---|---|---|
release |
string | β | latest |
Which Nerd Fonts release to install from. latest or a tag such as v3.4.0. |
destination |
string | β | ~/.local/share/fonts/NerdFonts |
Root directory. Each family gets its own subdirectory inside it. |
refresh_font_cache |
bool | β | false |
Run fc-cache -f <destination> after a successful install. |
families |
list of strings | β | β | Nerd Font archive names, without the .zip suffix. |
-
latestresolves to the newest release at run time and uses thereleases/latest/download/...URL form. - A tag like
v3.4.0pins the exact release. Use this in dotfiles if you want identical bytes on every machine. - An unknown tag is a user error: the tool exits
2withnerd fonts release "vX.Y.Z" was not found.
-
~and~/β¦expand to your home directory. - Relative paths are kept relative to the working directory β handy for testing
into
./tmp/fontsbefore touching your real font directory. - The directory is created if it does not exist.
- On Linux, set this to
true. Fonts generally will not appear in applications untilfc-cachehas run. - On macOS,
fc-cacheis usually not installed. The tool detects that, prints a note, and carries on β it is not an error.
Names must match the Nerd Fonts release archive names exactly β
JetBrainsMono, not JetBrains Mono and not JetBrainsMono Nerd Font.
Never guess:
nerd-fonts-installer --font-namesThat prints a ready-to-paste YAML block for whichever release your config pins.
Duplicates are rejected (duplicate font family "Hack"), and every name is
validated against path traversal before it is used in a URL or a file path.
The extension decides the parser.
| Extension | Parser | Unknown keys |
|---|---|---|
.yaml, .yml, .conf
|
YAML | β rejected |
.json |
JSON | β rejected |
Decoding is strict on purpose: a typo like familes: fails loudly instead of
silently installing nothing.
The same config in JSON
{
"release": "latest",
"destination": "~/.local/share/fonts/NerdFonts",
"refresh_font_cache": true,
"families": ["JetBrainsMono", "Hack", "FiraCode"]
}When --config is not passed, resolution goes in this order and stops at the
first hit:
-
--config <path>β explicit, wins over everything. -
$NERD_FONTS_INSTALLER_CONFIGβ an absolute or relative path. -
Current directory:
./nerd-fonts-installer.yaml./nerd-fonts-installer.yml./nerd-fonts-installer.json./nerd-fonts-installer.conf./nerd-fonts-installer/config.yaml./nerd-fonts-installer/config.yml./nerd-fonts-installer/config.json./nerd-fonts-installer/config.conf
-
$XDG_CONFIG_HOMEβ the same eight names, but only whenXDG_CONFIG_HOMEis set to an absolute path. -
~/.configβ the same eight names, used whenXDG_CONFIG_HOMEis unset, empty, or relative.
The recommended home for a personal config:
~/.config/nerd-fonts-installer/config.yaml
When a config is discovered rather than passed explicitly, the tool prints which one it picked:
Using config /home/dev/.config/nerd-fonts-installer/config.yaml
Tip
A project-local ./nerd-fonts-installer.yaml overrides your personal config
whenever you run the tool from that directory β useful for a repository that
ships its own font set.
| Variable | Effect |
|---|---|
NERD_FONTS_INSTALLER_CONFIG |
Path to a config file. Treated like --config, and honored by --font-names too. |
XDG_CONFIG_HOME |
Used for discovery when set to an absolute path. |
HOME |
Used to expand ~ in destination and to locate ~/.config. |
NERD_FONTS_INSTALLER_CONFIG=/etc/fonts.yaml nerd-fonts-installer--dry-run parses, validates, resolves the release, and prints the full plan
without writing a byte:
nerd-fonts-installer --config fonts.yaml --dry-runAnything wrong with the file surfaces here β before any download starts.
Next: π© CLI Reference Β· π³ Recipes
MIT licensed Β· Fonts by ryanoasis/nerd-fonts Β· TUI by Charm
Getting started
Reference
Help
Internals