@extoci/fonts
v0.1.0
Published
A small CLI for installing Google Fonts on your machine.
Readme
font
a tiny google fonts cli for installing fonts on your machine.
this exists because google fonts should be installable from the terminal without api keys, browser clicking, or downloading a zip like it is 2012.
usage
install globally:
npm install -g @extoci/fontthen:
font add interto launch the interactive installer:
font addit uses google-webfonts-helper, so you do not need a google api key.
requirements
- node 20+ for the published cli
- bun if you are developing locally
- internet access, obviously
- on linux,
fc-cacheis nice to have but not required
what it does
font add installs font files into your user font directory:
- macos:
~/Library/Fonts - linux:
~/.local/share/fonts(or$XDG_DATA_HOME/fonts) - windows:
%LOCALAPPDATA%\Microsoft\Windows\Fonts
installed fonts are tracked in a small manifest so font list, font remove, and font update know what this cli put there.
commands
interactive mode:
font addscriptable commands:
font add inter
font add inter -v regular,700
font download "Source Sans 3" --dest ./fonts --woff2
font find inter
font find --all
font list
font update
font remove interuseful flags
-v, --variants regular,700– install or download specific variants-d, --dest ./fonts– save font files somewhere instead of installing them--woff2– download woff2 files instead of ttf--refresh– refresh the cached google fonts catalog--all– print the whole catalog withfont find--limit 10– limitfont findoutput--select– pick one narrowedfont findresult interactively-y, --yes– skip prompts where possible
quick examples
install inter regular and bold:
font add inter -v regular,700search google fonts:
font find monoprint every font in the catalog:
font find --alldownload web fonts into your project:
font download inter --dest ./public/fonts --woff2remove fonts installed by this cli:
font remove interdevelopment
run with bun:
bun run devbuild:
bun run buildtest:
bun run testtroubleshooting
font addworked but the font is not showing up restart the app you are trying to use the font in. some apps cache the font list.linux font list did not refresh install
fontconfigsofc-cacheis available, then runfc-cache -f.search feels stale run with
--refreshto redownload the google fonts catalog.windows install is weird windows font installation is windows font installation. this cli installs into the current user's font directory and registers the font for that user.
notes
this is bun-first for development, but the published binary is a bundled node cli so npm install -g @extoci/font works normally.
acknowledgements
uses google-webfonts-helper for the font catalog and file urls. built by exotic with codex.
