@lazyclis/typing-trainer
v0.1.0
Published
Terminal typing trainer inspired by Typing.com and Monkeytype
Maintainers
Readme
Typing Trainer (CLI)
Terminal typing practice with a Typing.com + Monkeytype feel.
Features
- Minimal terminal UI with live correctness highlighting
- Modes:
words,punctuation,dev - Session styles:
- Timed test (
--time, default30seconds) - Text completion (finish text before timer)
- Timed test (
- Stats: net WPM, gross WPM, accuracy, errors, elapsed/remaining time, progress
- Built-in text sources + pluggable source interface
- Result history in JSON by default (
~/.typing-trainer/history.json)
Install / Run
Install globally from npm:
npm install -g @lazyclis/typing-trainer
typing-trainerRun locally from source:
npm install
npm startOr run as a CLI bin:
npm link
typing-trainerUsage
typing-trainer \
--mode words|punctuation|dev \
--time 15|30|60|120|<seconds> \
--source <sourceId> \
--set <setId> \
--strict \
--session timed|completion \
--seed <number>Other commands:
typing-trainer --list-sources
typing-trainer --list-sets book-of-mormon
typing-trainer --list-sets quotes
typing-trainer --history
typing-trainer --helpControls
Esc: pause menu (resume/restart/cycle mode/quit)Tab: quick restartCtrl+R: restartCtrl+N: next textF1or?: help overlayCtrl+C: quit
Config
Config file: ~/.typing-trainer/config.json
Example:
{
"defaultMode": "words",
"defaultSource": "quotes",
"defaultSession": "timed",
"defaultTimeSeconds": 30,
"enabledSources": ["quotes", "wordlist", "js-snippets"],
"seed": 123
}Plugin directory: ~/.typing-trainer/plugins
History storage:
- Default:
~/.typing-trainer/history.json - Optional SQLite: set
TYPING_TRAINER_USE_SQLITE=1to use~/.typing-trainer/history.db
Text Source Plugin Contract
A plugin exports an object with:
id: stringname: stringsupportedModes: ("words"|"punctuation"|"dev")[]listSets?: () => Promise<Array<{id: string, name: string}>>getText: (params) => Promise<{text: string, meta?: any}>warmup?: () => Promise<void>
params includes: mode, setId, strict, rng.
Optional config keys: defaultMode, defaultSource, defaultSession, defaultTimeSeconds, seed, enabledSources.
Built-in source: book-of-mormon
- Data file path:
assets/data/book-of-mormon.json - Sets:
alland one per book title
Example Plugin
See: src/plugins/example-local-txt-plugin.js
To use it as a user plugin:
- Copy it to
~/.typing-trainer/plugins/local-txt.mjs - Add
.txtfiles underassets/texts(or setTYPING_TRAINER_TEXT_DIR) - Run
typing-trainer --source local-txt
Project Structure
src/core: session/stats/normalization/rendering/history/configsrc/sources: built-in text source librarysrc/plugins: plugin loading + example pluginsrc/cli: CLI parsing and interactive runtimetests: unit tests for stats, normalization, and loader
Testing
npm test