( ´∀`)文字 Moji
Reference

CLI reference

Commands, flags, output modes, and defaults.

Command grammar

moji
moji <query> [flags]
moji get <query> [flags]
moji convert <input> [--to ttf|otf|woff2] [-o <output>] [--json]
moji inspect <input> [--json]
moji config [show]
moji cache clear
moji --version
moji --help

moji

When stdin and stdout are terminals, open the home TUI and wait for a font query. In a non-interactive process, print an actionable usage error instead of waiting for input.

moji <query>

Search enabled providers. When stdin and stdout are terminals, open the live TUI. Otherwise print a table. --json always prints structured output.

The results TUI keeps the query visible and presents every result as a source-bounded family candidate, including candidates that contain only one file. The Family, Files, Format, and Provider columns use one grid, and the Provider column shows only the provider name. enter opens the candidate and reveals its individual files. The family preview initially selects the highest-ranked file for each normalized weight and posture, so duplicate Bold files do not all enter a family download. a selects every file when needed; space toggles individual files. D downloads the current selection. The default order recommends the strongest match, while the other orders put the largest families or preferred formats first. Navigation and the current position remain in the footer. Provider details remain available from the Health screen instead of occupying settled results.

moji get <query>

Search, rank, select, and download. A trailing weight is parsed from the query. The phrases entire family and all weights select multiple files from the best family source.

moji convert <input>

Convert a local desktop font to WOFF2, or restore a WOFF2 font to the desktop format recorded inside it. Conversion runs entirely in the CLI. It does not load providers, use the result cache, or open the TUI.

moji convert Inter.ttf
moji convert Inter.otf --to woff2
moji convert Inter.woff2
moji convert Inter.woff2 --to otf -o build/Inter.otf

TTF and OTF inputs default to WOFF2. WOFF2 input defaults to TTF when it contains TrueType outlines and OTF when it contains CFF outlines. --to asserts an explicit target. Moji detects the source format from the file content, not its extension.

SourceTarget
TTFWOFF2
OTFWOFF2
WOFF2 containing TrueType outlinesTTF
WOFF2 containing CFF outlinesOTF

Moji changes the container flavor without converting glyph outlines. It rejects TTF-to-OTF, OTF-to-TTF, same-format conversions, font collections, and unsupported font formats.

Without --output, the converted file is written beside the input with the target extension. If the input already uses that extension despite containing a different format, Moji inserts .converted before the extension. Moji never replaces an existing destination. It writes and validates a temporary file before committing the completed output atomically. On Unix-like systems, the output inherits the input file's permission bits.

Plain output reports Converted: <path>. --json prints this stable object:

{
  "input": "Inter.ttf",
  "output": "Inter.woff2",
  "source_format": "ttf",
  "target_format": "woff2",
  "size": 12345,
  "sha256": "..."
}

moji inspect <input>

Read a local TTF, OTF, or WOFF2 font and report the Unicode scripts mapped by its character map. Inspection detects the source format from file content and does not load providers, use the result cache, or change the input file.

moji inspect Inter.ttf
moji inspect Inter.woff2 --json

Plain output includes the file identity, font family when present, glyph count, Unicode data version, and a table like this:

Script    Encoded  Assigned  Coverage
Arabic    471      1368      34.43%
Cyrillic  327      506       64.62%
Latin     1110     1481      74.95%

Encoded is the number of assigned characters in that script whose character map entry points to a glyph. Assigned comes from the Go toolchain's Unicode script tables. Coverage is Encoded / Assigned * 100. Scripts with zero encoded characters are omitted, so a missing script means zero coverage. The top-level encoded-character count includes every mapped Unicode scalar, including private-use characters that do not belong to a named script.

Inspection supports TTF, OTF, and WOFF2. It rejects font collections and the legacy WOFF1, dfont, PFB, and PFM formats. These formats need different character-map parsers, and PFM files contain metrics rather than glyphs.

moji config

Create the default config when missing, then open it with $EDITOR.

moji config show

Print effective configuration as JSON. The GitHub token is redacted.

moji cache clear

Delete cached provider responses and recreate the cache directory.

Flags

FlagShortDefaultMeaning
--format <list>-fconfig defaultComma-separated otf, ttf, woff, woff2, dfont, pfb, or pfm
--weight <name>-wanyKeep only a normalized font weight
--max <count>-nall in TUI / 10 output / 1 getMaximum results or downloads
--provider <list>all enabledComma-separated github, getfonts, dafont, fontsquirrel, fontshare, registry, plugins, or websearch
--jsonoffPrint machine-readable JSON
--dry-runoffPreview a get selection without downloading
--download-dir <path>-d~/Downloads/mojiDownload destination
--verbose-voffPrint provider failures, counts, and elapsed time
--debugoffPrint provider state and retry details
--no-cacheoffBypass cached search results
--token-stdinoffRead a GitHub token from standard input
--allow-insecureoffAllow HTTP for a source you explicitly trust
--to <format>inferredconvert only: target ttf, otf, or woff2
--output <path>-obeside inputconvert only: converted font output path
--help-hShow help and ignore other arguments
--versionPrint the installed Moji version

Flags may appear before or after query words. Values can use a separate argument or --flag=value.

TUI keys

KeyAction
typed textEnter a query on the home screen
enterStart the home-screen search or open result details
up / kSelect previous result
down / jSelect next result
page up / page downMove by one visible page
home / gSelect the first result
end / GSelect the last result
spaceToggle the active file in a family preview
a / nSelect all files or clear the selection in a family preview
DDownload selected result
/Filter loaded results
fCycle all, OTF, TTF, and WOFF2
oCycle best-match, most-files, and preferred-format ordering
tab / HOpen provider health
escClose details or exit
q / Ctrl-CExit

Standard streams

  • Search results and successful command output use stdout.
  • Diagnostics, verbose status, debug status, and errors use stderr.
  • Color is disabled when NO_COLOR is set or TERM=dumb.

On this page