Skip to content

Repository files navigation

nihongo

A minimal, blazing-fast Japanese dictionary CLI tool powered by Yomitan-compatible dictionaries (default: Jitendex).

Search instantly by romaji, hiragana, katakana, or kanji. Or look up Japanese words from English using the -e flag. All in a single static binary with zero external dependencies.

Features

  • ✅ Parses Yomitan's structured-content format: senses grouped under their part-of-speech, notes and cross-references attached to the sense they qualify, furigana preserved, alternate spellings/readings included
  • ✅ Interactive fuzzy search with go-fuzzyfinder (or plain list mode with -fzf=false)
  • Single static binary — no runtime dependencies, works everywhere Go does
  • ✅ Lightning-fast prefix + fuzzy matching on expressions and romaji readings
  • ✅ Supports input styles:
    • Romaji: sonzai, aruji, gohan
    • Hiragana: ぱん, ごはん, かんじる
    • Katakana: パン, パソコン, スーパーマーケット
    • Kanji: 日本語, 食べる,
    • English → Japanese: nihongo -e bread, nihongo -e existence
  • ✅ One-command dictionary setup: nihongo -download (pulls latest Jitendex automatically)
  • ✅ Import your own Yomitan dictionary: nihongo -import /path/to/dict.zip
  • ✅ View full entry details (definitions, example sentences, tags, etc.)
  • ✅ Lookup by internal ID: nihongo -id 115754
  • ✅ Show installed dictionary metadata: nihongo -info

What an entry looks like

Selecting a result (or looking it up with -id) shows the full card:

走る [はしる]  hashiru
Tags: ★ priority form
Also written/read: 奔る, 疾る, 趨る

Godan verb with 'ru' ending, intransitive verb
  1. to run
       e.g. あの走(はし)ってる少(しょう)年(ねん)をごらんなさい。
            Look at that boy running.[1]
  2. to run (of a vehicle); to drive; to travel; to move; to sail
       e.g. この車(くるま)は以(い)前(ぜん)ほど快(かい)調(ちょう)に走(はし)らない。
            This car is running less smoothly than it used to.[2]
  ...
  5. to run away; to abscond; to elope
       Note: occ. 奔る
  ...

Installation

Run with Nix

nix run github:jim-ww/nihongo -- 日本語

Or add it to your flake.nix.

Pre-built binaries

Check the Releases page for static binaries for Linux, macOS, and Windows.

Build from source

git clone https://github.com/jim-ww/nihongo.git
cd nihongo
go build -o nihongo .
sudo mv nihongo /usr/local/bin/

Or install directly:

go install github.com/jim-ww/nihongo@latest

Usage

nihongo [flags] <search-term>

Quick Examples

Japanese search (default interactive fuzzy mode):

$ nihongo 日本語

You will see a interactive list. Select any entry to view the full dictionary card.

Non-interactive list mode with internal IDs (-fzf=false):

$ nihongo -fzf=false 日本語

English search:

$ nihongo -e computer

Romaji / Kana / Kanji all work out of the box:

$ nihongo sonzai
$ nihongo ごはん
$ nihongo パソコン
$ nihongo 食べる
$ nihongo 感じる

Other useful commands:

# Download & install the default dictionary (Jitendex)
nihongo -download

# Or import a custom Yomitan dictionary
nihongo -import ~/Downloads/my-dict.zip

# Show info about currently installed dictionary
nihongo -info

# Lookup a specific entry by its internal ID
nihongo -id 115754

# Show romaji readings in the result list
nihongo -r 日本語

# Limit number of results
nihongo -l 10 日本語

# Clear cached downloads
nihongo -clearCache

Command-line Flags

Flag Description Default
-download Download latest Jitendex dictionary false
-import <path> Import a Yomitan .zip dictionary
-e Treat input as English (search definitions) false
-r Show romaji reading in result list false
-fzf Enable/disable interactive fuzzy finder true
-l <n> Limit number of search results 20
-id <n> Print full entry by database row ID
-info Show metadata of installed dictionary false
-showID Show database IDs in results (fzf mode only) true
-truncate Wipe previous dictionary before new import true
-dictDownloadUrl Custom dictionary download URL Jitendex latest
-clearCache Delete cached downloaded zip files false
-version Print version and build info false

Contributing

Bug fixes, improvements, new features, and ideas are welcome

Donate

If nihongo saves you time or brings you joy, consider a small donation:

Monero (XMR) 83YGRqP8uHed6NeegZQeX9ccCxbzoRHHEEi7pTwk4aqdJZEVXXA6NWtetnsEM2v33zFBBt3Rp6DNhU9qhJEGPspU14yN8t7

All donations are greatly appreciated and go directly toward keeping the project alive and adding new features.

License Notice

This program is free software licensed under the GNU General Public License v3 (GPLv3).

It means this is free software — you are free to use, study, share, and modify it however you like (as long as you keep the same freedoms for others).

About

A minimal, blazing-fast Japanese dictionary CLI tool powered by Yomitan-compatible dictionaries

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages