( ´∀`)文字 Moji
How-to guides

Automate Moji with JSON

Use structured output and exit codes in scripts and pipelines.

Add --json whenever another program will parse the output:

moji "Inter" --format otf --json

Search output is an array of result objects. Each object includes:

  • name, filename, format, and weight
  • size_bytes when known
  • source and the direct url
  • trusted and the best-effort license hint
  • the calculated score

Select a field with jq

moji "Inter" --format otf --json |
  jq -r '.[].url'

Preview an automated download

moji get "Inter bold" --dry-run --json |
  jq '.[0] | {filename, source, license}'

Check exit status

if moji get "Inter bold" --dry-run --json > selection.json; then
  jq '.[0]' selection.json
else
  echo "Moji could not select a font" >&2
  exit 1
fi

Moji writes primary data to standard output and diagnostics to standard error. Exit 0 means success, 2 means invalid command usage, and 1 means an operational failure.

On this page