Skip to content

Cli

cli

Defines the Kotobase CLI built on Typer and rendered with Rich

Command Groups
  • Query commands call the Kotobase wrapper and either pretty-print the result or emit machine readable JSON (--json)

  • Build and distribution commands defer to the Build Piepline

  • Commands to manage the package's cache directory which holds the database files and build artifacts

KB = Kotobase() module-attribute

Shared Kotobase instance which executes query commands

cache_clear(yes=False, sources_only=False, db_only=False)

Delete The Entire Kotobase Cache Directory, Or Specific Items Within It

cache_path()

Display The File System Path Of The Kotobase Cache Directory

cache_size()

Display The Total Disk Size Occupied By The Kotobase Cache Directory

db_build(force=False, with_links=True, with_audio=True)

Download Upstream Sources And Build The Database Locally

db_info()

Show Build Metadata For The Active Database

db_pull(tag=None, force=False, with_audio=True)

Download a Pre-Built Database From A GitHub Release

lookup_all(query, names=False, wildcard=False, sentence_limit=5, labels=False, as_json=False)

Run A Comprehensive Database Lookup For query Across All Data Sources

lookup_audio(key, out_dir=None, as_json=False)

List Or Download Pronunciation Audio For A Kanji Or Word

lookup_find_kanji(stroke=None, grade=None, skip=None, freq=None, level=None, limit=30, as_json=False)

Search A Kanji By Its Stroke Count, Grade, SKIP Code, Frequency Or JLPT Level

lookup_furigana(word, as_json=False)

Show Furigana Segmentation For A Written Form

lookup_jlpt(word)

Show JLPT Levels For A Word And Its Kanji

lookup_jlpt_list(kind, level, as_json=False)

Show A Full Tanos JLPT Study List By Its Kind And Level

lookup_kanji(literal, as_json=False)

Display All Available Information For A Single Kanji Literal

lookup_kanji_svg(literal, raw=False)

Print A Kanji's Stroke Order As A Renderable SVG Document

lookup_meaning(query, limit=30, as_json=False)

Find Entries By Their English Meaning

lookup_names(form=None, name_type=None, as_json=False)

Look Up Or Browse JMnedict Proper Names

lookup_radicals(components=None, as_json=False)

List Kanji Radicals, Or Find Kanji That Contain Every Given Radical

lookup_sentences(text_value, limit=10, as_json=False)

Find Japanese Example Sentences Containing A Specific Text

version()

Prints The Installed Kotobase Version