fontsona
v0.4.0
Published
Fontsona on the command line: sign in, list your presets, resolve a type scheme to fonts.css, check fonts, install the Skill, register the fonts installed on your computer by name, and run the helper that lets the Fonts page list them in Safari and Firefo
Maintainers
Readme
fontsona
The command-line client of Fontsona: your licensed fonts and saved type
presets, read from a terminal, and the fonts installed on your computer added to your account by
name. It talks to the same server your AI tools use (https://fontsona.ai/mcp). Zero dependencies,
Node 20 or later.
npx fontsona login # or: npm install -g fontsonaYou need a Fontsona account; it is free, and signing in for the first time creates it.
| Command | What it does |
|---|---|
| fontsona login [--origin URL] | Signs in: opens the browser to Fontsona, you approve, and the credentials are saved to ~/.config/fontsona/credentials.json (mode 0600). OAuth 2.1 with PKCE and a loopback redirect; refreshed automatically. |
| fontsona logout | Deletes the credentials file. |
| fontsona whoami · fontsona presets | Your plan, font scope and default behaviour; your numbered presets. |
| fontsona resolve --langs zh-Hans,en --medium web [--preset 2] [--brief "…"] [--mode parallel] [--roles heading,body,code] [--out ./fonts] [--report "title"] | A type scheme for those languages and that medium. With --out it writes fonts.css and scheme.json and downloads the font files, ready to link from a page. |
| fontsona check <file\|-> --font "Family[:weight]" … | Checks the file's text against the fonts you name: missing characters, weights, embedding rights. |
| fontsona search "…" [--script Hans] [--role heading] [--limit 12] | Finds fonts among yours and open-source ones. |
| fontsona similar <family> --kind similar\|substitute\|companion [--script Jpan] | Look-alikes, an open-source stand-in, or a matching family in another script. |
| fontsona assets --scheme <id> \| --preset 2 [--out dir] [--format ttf] | The font files behind a scheme or a preset, downloaded. |
| fontsona skill install [--target claude\|codex] [--dir <skills dir>] | Downloads the Fontsona Skill into Claude Code (~/.claude/skills) or Codex (~/.agents/skills). |
| fontsona scan [words…] [--user \| --system] [--foundry <name>] [--files] | The fonts installed on this computer, by family and numbered, with their foundry and where they came from. Words search the list; --user keeps the fonts you or your apps installed, --system the ones that came with the system; --files lists every file. Nothing is sent. |
| fontsona scan --register <numbers \| "family names" \| all> [--team] [--yes] | Adds those families to your fonts by name, as the installed-fonts picker on the Fonts page does in Chrome and Edge. Asks first whether you have the right to use them (--yes answers it). --team adds them to your team's library. |
| fontsona connect [--allow-origin URL] [--port N] | Starts Fontsona's helper: in Safari and Firefox the Fonts pages then list the fonts installed on this computer, as they do in Chrome. Runs until Ctrl+C. |
| fontsona connect --install [--allow-origin URL] [--port N] | Sets the helper up to run in the background instead: it starts now and each time you log in, with no window to keep open. |
| fontsona connect --uninstall | Stops the background helper and removes it. |
--json prints the structured result instead of the text summary. --version prints the version.
FONTSONA_CONFIG_DIR overrides where credentials are kept. A tool error exits with code 2.
Installed fonts in Safari and Firefox: the helper
Chrome and Edge list the fonts installed on your computer to the Fonts page by themselves; Safari and Firefox cannot. With the helper running, in those browsers the Fonts page, Team fonts and Similar Fonts list them too, and upload, register or measure the ones you tick, the same way as in Chrome. Set it up once to run in the background, started by the computer each time you log in:
npx fontsona@latest connect --install # @latest: npx may otherwise run a copy from before `connect`Or run it only until you close the window (Ctrl+C stops it):
npx fontsona@latest connectWhen npx fetches the package (the first time, and after a new version), it asks “Ok to proceed?”: type y and press Return.
- What it is. A small web server on your computer, at 127.0.0.1 only (ports 36687, 36688 or
36689), that reads the installed fonts as
fontsona scandoes. It needs no sign-in. - Who can read it. Only pages of fontsona.ai (by their Origin), on this computer alone; a
request from another website is refused, and so is one addressed to any host other than this
computer.
--allow-origin http://localhost:8787adds a test server. It never tells a page where a font is on disk. - What it sends. Nothing, by itself: the page sends the fonts you choose to fontsona.ai, with your own sign-in, exactly as it does in Chrome. The terminal says what the page read and took.
- In Safari a small window opens for a moment each time the page asks the helper (Safari lets no https page read an http address, this computer's own included): that is the helper handing the fonts over. If Safari blocks it, allow pop-up windows for fontsona.ai.
- To stop it, press Ctrl+C in its window or close the window; one in the background:
npx fontsona@latest connect --uninstall.
In the background (--install)
- What starts it. On a Mac, a LaunchAgent (
~/Library/LaunchAgents/ai.fontsona.helper.plist) that launchd starts at each login, and again if it stops by accident; macOS may say that “node” can run in the background (System Settings › General › Login Items): that is the helper. On Windows, a launcher in your Startup folder (Fontsona helper.vbs) that runs Node with no window; not yet tried on a real PC. On Linux, an XDG autostart entry (~/.config/autostart/fontsona-helper.desktop), which desktop sessions start at login. - What runs. npx keeps its copy in a cache it may clear, so the program (it has no
dependencies) is first copied to a folder of its own:
~/Library/Application Support/Fontsona/helperon a Mac,%LOCALAPPDATA%\Fontsona\helperon Windows,~/.local/share/fontsona/helperon Linux. It runs with the Node you ran the command with (Homebrew's or the installer's link where it points at that Node, so an upgrade of Node does not break it). - Its version. The copy keeps to the version you installed: run
--installagain to bring it up to date (it replaces the one running). - Its log. What pages take from it, with the date:
~/Library/Logs/Fontsona/helper.logon a Mac,%LOCALAPPDATA%\Fontsona\helper.logon Windows,~/.local/state/fontsona/helper.logon Linux. Emptied when it passes 1 MB. - Beside a helper in a terminal. If one already runs in a window, the background helper waits,
and takes over once that one stops;
connectbeside a background helper says it is there and ends. - On a computer shared by several accounts, other accounts' programs could ask a running helper for your installed fonts (it answers anything on this computer that names fontsona.ai as its page); keep it to a window there, or don't run it.
- To remove it:
npx fontsona@latest connect --uninstallstops it and removes the item that starts it, the copy and the log.
Installed fonts, registered by name
The Fonts page registers installed fonts by name: Chrome and Edge list them, Safari and Firefox
list them with the helper above or take the font files instead. fontsona scan does the same from
a terminal, in any setup, and also finds fonts that an app activates without a file you could
choose:
npx fontsona scan # every family installed here, numbered; nothing is sent
npx fontsona scan avenir # search the list
npx fontsona scan --register 3 "Avenir Next"- What it reads. On a Mac, the list of fonts Core Text gives every program, or the Fonts
folders when that fails. On Windows, the Fonts folders and the fonts the registry names. On
Linux, fontconfig (
fc-list). The first line of the list says which. Fonts the system keeps out of its font menus (their names start with a dot) are left out. - What is sent. For each font, a description: its names, weights, licence note, line
measurements and the list of characters it has. The letter shapes stay on your computer, and
nothing at all is sent until you pass
--register. It is the same description the website's picker sends, so a font registered either way is the same font in your account. - Your account. Each family you register counts toward your plan's font families. A family holds at most 36 fonts, and a font already in your fonts is said to be there, not added twice.
- Permission. Registering needs the
fonts:writepermission, whichfontsona loginasks for from version 0.2.0. If you signed in with an earlier version, runnpx fontsona loginonce more. AI tools never get this permission.
Docs: https://fontsona.ai/docs/ · Help: [email protected]
MIT licence. The licence covers this client, not the fonts it downloads: each font keeps its own.
