Skip to content
Kotoshu Kotoshu 言修

Install

Pick your channel

Eight channels, one engine. The checking core has two native implementations — the Ruby gem and the Rust crate — proven byte-identical on a frozen conformance contract, and every channel below builds on one of them.

Client + native engine

pip install kotoshu kotoshu-native

機関 engines and bindings

Every channel above is a first-class client, and four of them run the checking engine in-process. The engine has exactly two implementations — pure Ruby and Rust — held byte-identical by a frozen conformance contract that CI enforces on every change. Whichever runtime you choose, the outputs are the same; the difference is speed.

  • Ruby installs the Rust engine as a precompiled native platform gem on Linux, macOS, and Windows — gem install kotoshu resolves it automatically on a matching machine, and the auto backend uses it whenever it loads. Every other platform gets the pure-Ruby gem, which is always published and needs nothing beyond Ruby itself; KOTOSHU_BACKEND=native or =ruby still forces an engine explicitly.
  • Python embeds the Rust engine through the kotoshu-native wheel — a Rust FFI binding — for fully offline, in-process checking; the plain kotoshu package speaks HTTP instead.
  • JavaScript and the browser run the Rust engine compiled to WebAssembly (@kotoshu/wasm), with language packs that load a whole language in one fetch.
  • Rust uses the engine crate directly.

Resolution is automatic and needs no compiler anywhere: a prebuilt native artifact installs wherever one exists for your platform — x86_64 and aarch64 Linux, both macOS families, and Windows — and the pure-Ruby implementation is the fallback everywhere else, so no install path ever builds anything. Python's kotoshu-native package follows the same rule with one wheel per platform and Python 3.10–3.13. Where the Rust engine is in-process it is roughly 10–15× faster on the suggestion sweep than optimized pure Ruby (English full dictionary: about 45 ms versus 661 ms average per suggestion), and it is the only option in the browser. For batch CI checking the gap barely matters — both engines check in milliseconds, and the conformance contract guarantees identical results either way.

辞書 the channel catalog

ruby

Ruby — library & CLI 宝石

The reference gem (1.0.6): two-stage resources, model tiers, 35 full-feature languages, optional native extension.

gem install kotoshu

Ruby API →

python

Python — client + native engine 蛇

kotoshu 0.1.0 over HTTP; kotoshu-native 0.1.0 embeds the Rust engine for offline checking.

pip install kotoshu kotoshu-native

Python client →

js

JavaScript & TypeScript — client + wasm 波

@kotoshu/client 0.1.0 for Node, Deno, Bun, browsers; @kotoshu/wasm 1.1.0 runs the engine in-process with loadPack language packs.

npm install @kotoshu/client

JavaScript client →

rust

Rust — the engine itself 錆

The kotoshu crate 0.1.0: dictionaries, ranked suggestions, the C ABI batch format.

cargo add kotoshu

Rust engine →

go

Go — HTTP client 囲碁

kotoshu-go v0.1.0: context-aware check, suggest, detect, correct.

go get github.com/kotoshu/kotoshu-go@v0.1.0

Go client →

http

HTTP — the server 服務

Seven JSON endpoints (1.0.1): checking with the optional model flag, suggestions, and 176-language detection — the contract every SDK speaks.

gem install kotoshu-server

HTTP API →

lsp

Editor — via LSP 編集

kotoshu-lsp 0.1.1: diagnostics, quick-fixes, hover suggestions in any LSP editor, with the personal dictionary read live.

gem install kotoshu-lsp

Editor integration →

ci

CI — GitHub Action 検証

action-kotoshu v2: directory mode, CI baselines, include/exclude, and SARIF in the Security tab, with dictionaries cached between runs.

uses: kotoshu/action-kotoshu@v2

GitHub Action →

Ruby — the sixty-second path

gem install kotoshu

# Stage 1 — set up a language once (downloads the dictionary, ~5 MB)
kotoshu setup en

# Stage 2 — check, cache-only, instant
echo "helo wrold" | kotoshu check
kotoshu check README.md --format sarif
kotoshu check README.md --interactive

In Ruby: Kotoshu.setup(:en) then Kotoshu.check("helo wrold"). Optional semantics: gem install onnxruntime. The model ships in three tiers — fluency (~15 MB, the default), full (~120 MB), or mini (~3 MB) — covered in Caching & resources; measured check and sweep latencies are on Performance. Thirty-five languages have the full feature set — dictionary, semantic model,

Every other staged language works too on the basic tier — setup any of the 95 and check immediately; full-feature languages add keyboards and verified specimens.

keyboard layouts — and semantic models exist for 55: the counts live on the language matrix. Rails validators, RSpec matchers, Rake, and Jekyll integrate with no new dependencies — framework integrations. On Windows the same commands hold — CI proves Ruby 3.3, 3.4, and 4.0 on windows-latest — see Kotoshu on Windows.

Exit codes

0 No spelling errors
1 Errors found
2 Usage error
3 Language not set up — run kotoshu setup LANG

Not sure which surface is yours? The audiences guide matches how you work to what to install — every persona now links straight to its channel guide.