codetype
v1.0.1
Published
Offline terminal code-typing practice game (Python-powered)
Maintainers
Readme
⌨️ CodeType
Offline terminal code-typing practice — sharpen your speed on real code.
A fast, distraction-free typing trainer that runs entirely in your terminal. Practice on real snippets across nine languages, track your WPM, and beat your own records — no browser, no accounts, no network.
✨ Features
- Real code, nine languages — Python, JavaScript, TypeScript, C, Go, Rust, Java, SQL, and Bash.
- Speed-test mode — a fresh block of common words each run for raw typing speed.
- Live metrics — WPM, accuracy, and a timer that starts on your first keystroke.
- Smart indentation — leading whitespace on new lines auto-skips, so you type code, not spaces.
- Persistent stats — every run is saved locally; view your history and per-language bests anytime.
- Fully offline — pure Python standard library (
curses). No dependencies, no telemetry.
🚀 Installation
Via npm (recommended)
npm install -g codetype
codetypeRequires Python 3.8+ on your
PATH. The npm package ships a small Node launcher that runs the bundled Python game. On Windows the launcher will prompt you topip install windows-cursesif needed.
Via pip / pipx
If you prefer a native Python install:
pipx install codetype-cli
codetypeOr from a clone:
git clone https://github.com/rohan4naik/codetype-cli
cd codetype-cli
pip install .
codetypeNo install
Run straight from a clone:
python3 -m codetype🎮 How to play
- Pick a mode from the menu — a language,
sentences (speed test), orrandom. - Type the snippet exactly. Correct characters turn green; mistakes flash red and must be backspaced before you can continue.
- Press Enter at the end of each line — indentation on the next line is skipped for you.
- Watch your stats update live in the header, then review your result on the finish screen.
Select history from the menu to see your last 15 runs and all-time bests per language.
⌨️ Keys
| Key | Action |
| --- | --- |
| ↑ ↓ / k j | Navigate menu |
| Enter | Select / new line / next snippet |
| Backspace | Fix a mistake |
| Tab | Restart current snippet |
| Esc | Back to menu / quit |
📊 Stats
Every completed run is appended to ~/.codetype/stats.json — WPM, accuracy, errors, time, and
date. The results screen highlights a ★ new best whenever you beat your record for that language.
🧩 Adding your own snippets
Edit codetype/snippets.py — append strings to any language list, or add a
new language key. Use spaces for indentation, not tabs.
