A tiny terminal game for learning Unix and Readline keyboard shortcuts.
Try it in your browser: the real game in a sandboxed terminal, no install.
It runs a simulated command line, so practice never executes a real shell command. Each drill gives you a target line and tracks the keyboard presses needed to solve it. The expected number is perfect in green, up to two extra presses are close in yellow, and larger detours are red.
Requires Node.js 20 or newer. Once published, install Key Reps globally:
npm install --global @soleone/keyreps
keyrepsYou can also run it without a global install:
npx @soleone/keyrepsThe program needs an interactive POSIX terminal. Press Ctrl+C to quit, Esc to
reset a drill, Enter to submit it, Ctrl+Up for the next lesson, and
Ctrl+Down for the previous lesson.
When a Nerd Font is installed, the interactive UI adds a few small icons to its
section landmarks. Detection uses fc-list; set KEYREPS_ICONS=text
to keep the text-only layout or KEYREPS_ICONS=nerdfont to force the icons.
When running under Omarchy, Key Reps reads the active theme from
$XDG_STATE_HOME/omarchy/current/theme/colors.toml and uses its accent, text,
status, border, and panel colors. Outside Omarchy it falls back to basic ANSI
colors. Set KEYREPS_THEME_FILE to preview another Omarchy-compatible
colors.toml file. While the game is running, it checks for theme changes every
750 ms and redraws after a successful reload.
The drills progress from individual shortcuts to command combinations. Intermediate stages require several editing commands in one repair. Expert stages hide their instructions until a wasted key press or failed attempt reveals the safety net.
Ctrl+AandCtrl+E: start and end of lineCtrl+B,Ctrl+F, and the left/right arrow keys: character movementAlt+BandAlt+F: word movementCtrl+LeftandCtrl+Right: word movement when supported by the terminalCtrl+UandCtrl+K: kill to the start or endCtrl+WandAlt+D: kill wordsCtrl+Y: yank the last killCtrl+T: transpose charactersCtrl+D: delete under the cursor
The editor, terminal decoder, and game state are separate so the behavior can be tested without needing a terminal.
From a checkout, install dependencies, run the tests, and start the compiled CLI:
npm install
npm test
npm run build
node dist/src/cli.js
npm run demo # the browser demo at http://localhost:4321
npm run media:capture # re-record demo/media (needs agent-browser and FFmpeg)For local development, npm link makes the command available as keyreps.
npm link
keyrepsReleases use release-it from a
clean main or master checkout. Release tooling requires Node 22+ and npm
10+; the CLI itself still supports Node 20+. It runs the tests, bumps the
package version, creates a Git tag, and submits the package to npm's staging
queue.
Preview a release without changing Git or publishing anything:
npm run release -- patch --dry-runTo perform a release, choose a version increment instead:
npm run release -- patchAfter the release is staged, review it and approve it with your npm passkey:
npm stage list
npm stage view <stage-id>
npm stage approve <stage-id>