Skip to content

seanaujong/ttype

Repository files navigation

ttype

A type-racer for your terminal. Drill on the text you actually read — prose, source files, git commits, PRs, and diffs — all through one engine. Built on Ink.

Demo

ttype.mp4

Install

ttype isn't published to npm — install it from a local clone:

npm install   # installs dependencies and builds dist/ (the prepare script runs the build)
npm link      # symlinks `ttype` onto your PATH

npm link symlinks the package globally; undo it later with npm rm -g ttype.

Usage

ttype path/to/essay.txt    # race a file
ttype source/app.tsx       # ...source included — tabs and wide chars are handled
cat notes.md | ttype       # or pipe via stdin
git show HEAD | ttype      # a commit
git diff | ttype --split   # a diff, two-column: typed (+) left, reference (-) right
ttype --cloze essay.txt    # after the run, re-drill the words you fumbled

Diff rendering is automatic for .diff / .patch files; --diff forces it and --split implies it.

With --cloze, finishing a run re-drills the words you fumbled (slowest + most-mistyped) as fill-in-the-blanks — or press c on the results screen to start that re-drill after any run.

Controls

  • Type to race — correct characters turn green, mistakes red.
  • Tab / Shift+Tab — before you start, skip to the next / previous chunk (paragraph, diff hunk, …).
  • Esc — restart the run.
  • c (on the results screen) — re-drill the words you fumbled as fill-in-the-blanks; --cloze does it automatically.
  • Ctrl+C — quit.

Develop

npx tsx source/cli.tsx <args>   # run straight from source, no build step
npm run dev                     # tsc --watch
npm test                        # prettier + xo + ava
npm run fix                     # auto-format, then lint-fix

See docs/ for the architecture and design notes.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors