CLI Reference¶
The kotobase command line is built with Typer
and rendered with Rich
It's organized into 3 command groups + a couple of root commands
Most lookup commands accept -j / --json to emit machine readable JSON
instead of the panelled output
Lookup Commands¶
kotobase lookup Commands Query The Database
Pre-Requisite
-
Every
lookupcommand needs the database -
If it's missing, the command prints a hint to run
kotobase db pullorkotobase db buildand exits with a non-zero status
lookup all¶
Runs a comprehensive lookup across every source and render one aggregated panel
Options¶
| Option | Description |
|---|---|
-n / --names |
Include proper name results from JMnedict |
-w / --wildcard |
Treat * + % As Wildcards In The Query |
-sl / --sentence-limit |
Number Of Example Sentences To Show (Default 5) |
-l / --labels |
Expand Tag Codes To Their Descriptions |
-j / --json |
Format Result As JSON |
Examples¶
kotobase lookup all 日本語 # (1)!
kotobase lookup all "食べ*" -w # (2)!
kotobase lookup all 田中 -n # (3)!
kotobase lookup all 勉強 -l # (4)!
- Dictionary Etries, Kanji, JLPT, and Sentences For The Word
- Treat
*+%As Wildcards - Also Include Proper Names From
JMnedict - Expand Dictionary Tag Codes To Their Human Description
lookup kanji¶
Displays the full profile of a single kanji, its readings, meanings, stroke count, grade, frequency, JLPT level, radicals, SKIP and dictionary references
Options¶
| Option | Description |
|---|---|
-j / --json |
Format Result As JSON |
Examples¶
- The Full Kanji Profile As A Panel
- The Same Data As
JSON
lookup jlpt¶
Shows the JLPT vocabulary level of a word and the JLPT level of each kanji in it
Examples¶
- The Vocabulary Level Plus Each Kanji's Level
lookup kanji-find¶
Searches kanji by scalar attributes, combine filters to narrow the results
Options¶
| Option | Description |
|---|---|
-s / --stroke |
Required Stroke Count |
-g / --grade |
Required School Grade |
--skip |
SKIP Query Code, Such As 1-4-3 |
-f / --freq |
Maximum Newspaper Frequency Rank |
--jlpt |
Required Tanos JLPT Level |
-l / --limit |
Maximum Results (Default 30) |
-j / --json |
Format Results As JSON |
Examples¶
kotobase lookup kanji-find --jlpt 5 # (1)!
kotobase lookup kanji-find -s 8 -g 2 # (2)!
kotobase lookup kanji-find --skip 1-4-3 # (3)!
- Every Kanji In Tanos JLPT N5
- Eight-Stroke Grade 2 Kanji
- Kanji With The Given SKIP Code
lookup radicals¶
Lists every search radical grouped by stroke count, or finds the kanji that contain every given radical
Options¶
| Option | Description |
|---|---|
-j / --json |
Format Results As JSON |
Examples¶
- List Every Search Radical Grouped By Stroke Count
- Kanji Containing Both Radicals
lookup jlpt-list¶
Shows a full Tanos JLPT study list for a kind and level
KIND is one of vocab, kanji or grammar, and LEVEL is 1 to 5
Options¶
| Option | Description |
|---|---|
-j / --json |
Format Results As JSON |
Examples¶
kotobase lookup jlpt-list vocab 5 # (1)!
kotobase lookup jlpt-list kanji 3 # (2)!
kotobase lookup jlpt-list grammar 2 # (3)!
- The Full N5 Vocabulary List
- The Full N3 Kanji List
- The Full N2 Grammar List
lookup names¶
Looks up or browses JMnedict proper names
Options¶
| Option | Description |
|---|---|
-t / --type |
Browse A Name Type, Such As place |
-j / --json |
Format Results As JSON |
Examples¶
- Search A Name By Its Form
- Browse Every Name Of A Given Type
lookup meaning¶
Finds dictionary entries by their English meaning, using the gloss full text index
Options¶
| Option | Description |
|---|---|
-l / --limit |
Maximum Results (Default 30) |
-j / --json |
Format Results As JSON |
Examples¶
- Entries Whose Gloss Matches The Query
- Cap The Number Of Results
lookup sentences¶
Finds Japanese example sentences containing a text, with their English translations
Options¶
| Option | Description |
|---|---|
--limit |
Maximum Results (Default 10) |
-j / --json |
Format Results As JSON |
Examples¶
- Sentences Containing The Text
- Show More Results
lookup furigana¶
Shows the furigana segmentation for a written form
Options¶
| Option | Description |
|---|---|
-j / --json |
Format Result As JSON |
Examples¶
- The Spelling Aligned To Its Reading
lookup kanji-svg¶
Prints a kanji's stroke order as a renderable SVG document, redirect it to a file to open in a browser
Options¶
| Option | Description |
|---|---|
--raw |
Emit The Raw KanjiVG Fragment Instead Of A Renderable SVG |
Examples¶
- A Self-Contained SVG With A
109View Box And Overridable Stroke Styling - The Original KanjiVG
<kanji>Fragment, For KanjiVG-Specific Tooling
lookup audio¶
Lists the pronunciation audio clips for a kanji or word, or downloads them with -o
Options¶
| Option | Description |
|---|---|
-o / --out |
Directory To Save The Audio Clips Into |
-j / --json |
Format Result As JSON |
Examples¶
- List Every Bundled Clip With Its Reading, Format, Source And License
- Save Each Clip Into
./clipsNamed<reading>.<format>
Needs The Audio Pack
-
The Actual Audio Data Lives In The Optional
Audio Pack -
Install It With
kotobase db pull --with-audioOrkotobase db build --with-audio
Database Commands¶
kotobase db Commands Build Or Download The Database
db info¶
Shows the build metadata recorded in the active database
Examples¶
- Schema Version, Build Date, Size And Source Versions
db build¶
Downloads the upstream sources and builds the database locally
Options¶
| Option | Description |
|---|---|
-f / --force |
Rebuild Even When A Database Already Exists |
--with-links / --no-links |
Align Tatoeba Sentences With English (Default On) |
--with-audio / --no-audio |
Also Build The Optional Audio Pack (Default On) |
Examples¶
- Build The Core + Audio Databases
- Build Only The Core Database
- Rebuild Even If Present
db pull¶
Downloads a prebuilt database from a GitHub Release
Options¶
| Option | Description |
|---|---|
-t / --tag |
Release Tag To Pull From (Default The Latest Release) |
--force |
Replace An Existing Database |
--with-audio / --no-audio |
Also Pull The Audio Pack (Default On) |
Examples¶
- Pull The Core + Audio Databases
- Pull Only The Core Database
- Pull From A Specific Release
Cache Commands¶
kotobase cache Commands Manage The Per-User Cache Directory That Holds The Databases And Downloaded Sources
cache clear¶
Deletes the entire cache directory, or only specific items within it
Options¶
| Option | Description |
|---|---|
-y / --yes |
Skip The Confirmation Prompt |
--sources-only |
Delete Only The Downloaded Raw Sources |
--db-only |
Delete Only The Built Or Pulled Databases |
Examples¶
- Delete Everything (Asks First)
- Delete Everything Without Confirming
- Delete Only The Databases
cache path¶
Prints the file system path of the cache directory
Examples¶
- The Resolved Cache Directory
cache size¶
Shows a breakdown of the cache disk usage
Examples¶
- Per-Item And Total Disk Usage
Version¶
Prints the installed kotobase version