Browse and install google fonts using terminal
May 28, 2026 ยท View on GitHub
Note: If you encounter some errors after upgrade, clean cache files described at the end of the page.
Supported platforms
- Linux
- MacOS
Google Fonts API
By default, gfont doesn't need google font API key, instead it uses generated data/webfonts.json. This generated file won't be refreshed very often and contains older fonts. If you want more up-to-date fonts, add your own API key via 'gfont apikey --key <YOUR_KEY>' command.
See Google Fonts Developer API to generate your API key.
Installation
Note: For linux, pipx is recommended instead of pip
Using pip
pip install "git+https://github.com/nureon22/gfont.git"
Using pipx
pipx install "git+https://github.com/nureon22/gfont.git"
Using zipapp
- Download gfont.pyz from Release Page
- Give gfont.pyz executable permission.
chmod +x gfont.pyz - Copy gfont.pyz to your PATH and you're ready to go
Notes: To get the new version, you need to follow the steps above again if you're using this method.
For ArchLinux
For ArchLinux gfont package is available in AUR
Requirements
- python 3.8 or newer
- python-venv
- git
Runtime Dependencies
- requests
Development Dependencies
- hatch (development)
Usages
All commands support case-insensitive family names.
You can also use underscore (_) or dash (-) or plus (+) instead of space character in family name.
Search
Search available families
gfont search noto sans
Install
Install one or more families
gfont install noto-sans
Remove
Remove one or more families
gfont remove noto-sans
Info
View overview information of the family
gfont info noto-sans
List
List installed families
gfont list
Update
Update installed families to latest version
gfont update
Webfont
Pack woff2 fonts and it's css to be used as self-hosted fonts in websites.
Don't forget to use single or double quotes for safety.
gfont webfont "noto-sans" --dir <dir>
gfont webfont "noto-sans:ital,wght@0,400;0,700" --dir <dir>
gfont webfont "open-sans:ital,wght@0,300..700" --dir <dir>
Tricks
Install search results
gfont install $(gfont search noto sans | sed 's/ /_/g')
For mor information
gfont <command> --help
Related directories
Directory for cached metadata of families
Linux: ~/.cache/gfont
Mac: ~/Library/Caches/gfont
Directory for installed fonts
Linux: ~/.local/share/fonts/gfont
Mac: ~/Library/Fonts/gfont