_ _
| | _____ _ _| |__ _ __
| |/ / _ \ | | | '_ \| '__|
| < __/ |_| | |_) | |
|_|\_\___|\__, |_.__/|_|
|___/
type. learn. master.
keybr-tui
A terminal typing trainer with adaptive learning, inspired by keybr.com.
keybr-tui generates practice text using phonetic Markov chains and adapts to your weaknesses in real time. Letters are introduced progressively as you demonstrate proficiency, so you always practice what you need most.
Features
- Adaptive text generation using phonetic Markov chains (faithful port of the keybr.com algorithm)
- Per-key confidence tracking with exponential smoothing of reaction times
- Progressive letter unlocking based on your performance against a target speed
- Persistent progress across sessions (stats and config saved automatically)
- Backspace and error recovery with two error modes (forgive mistakes / stop on error)
- Lesson summary after each practice round showing WPM, accuracy, and weakest keys
- Progress view to review per-key statistics
- Configurable settings (target WPM, error mode, fragment length)
- Minimalist terminal-native UI built with ratatui
Install
Quick install (Linux & macOS)
|
The script downloads the latest prebuilt binary for your platform and installs it to /usr/local/bin (or ~/.local/bin if not root). Pin a specific version with KEYBR_TUI_VERSION=v0.1.0.
From crates.io
Prebuilt binary
Each tagged release on the releases page ships prebuilt binaries for Linux (x86_64), macOS (Intel and Apple Silicon), and Windows (x86_64). Unix archives are .tar.gz, Windows is .zip.
From source
Usage
Options
| Flag | Description |
|---|---|
--target-wpm <N> |
Set target typing speed in words per minute (default: 35) |
--error-mode <MODE> |
move-on (default) or stop-on-error |
--reset |
Delete saved stats and start fresh |
--data-dir |
Print the data directory path and exit |
--help |
Show help |
--version |
Show version |
Keyboard Shortcuts
| Key | Action |
|---|---|
Esc |
Return to menu / quit |
Enter |
Select menu item / dismiss lesson summary |
| Arrow keys | Navigate menus and settings |
Left/Right |
Adjust settings values |
How the Adaptive Algorithm Works
keybr-tui uses a phonetic text generation algorithm ported from keybr.com:
- Letter scheduling: You start with a small set of letters (6). The scheduler tracks your per-key reaction time using exponential smoothing and computes a confidence score against your target speed.
- Unlocking: When all active letters reach sufficient confidence, a new letter is unlocked from a frequency-ordered list.
- Focus key: The weakest key among your active set becomes the "focus key" and appears more frequently in generated text.
- Text generation: A Markov chain trained on English phonetic patterns generates pronounceable pseudo-words using only your active letters, with bias toward the focus key.
- Tracking: Each keystroke's reaction time is recorded, filtered, and smoothed to update your per-key statistics.
Project Structure
keybr-tui/
├── src/
│ ├── main.rs # Entry point
│ ├── app.rs # Central state (MVU)
│ ├── update.rs # State transitions
│ ├── ui.rs # Rendering (read-only state)
│ ├── events.rs # Input + tick event channel
│ ├── tui.rs # Terminal setup/teardown
│ ├── metrics.rs # Per-key statistics
│ ├── config.rs # Config file parsing
│ ├── persistence.rs # Stats save/load
│ ├── engine/ # Adaptive text generation
│ └── components/ # UI widgets
├── docs/ # User-facing docs (comparison, FAQ, troubleshooting)
└── .github/workflows/ # CI and release
Development
Build:
Run:
Test:
Format:
Lint:
See CONTRIBUTING.md for the full contribution workflow.
Configuration
Config file location (XDG on Linux):
~/.config/keybr-tui/config.toml
Example config:
= 35
= "forgive-mistakes" # or "stop-on-error"
= 100
Stats are saved separately in the data directory. Use keybr-tui --data-dir to find it.
Screenshots
A terminal recording (asciinema/vhs) is on the roadmap. For now, run cargo install keybr-tui and try it.
Documentation
- docs/comparison.md — how keybr-tui compares to alternatives
- docs/faq.md — frequently asked questions
- docs/troubleshooting.md — common issues and fixes