Neil Mahajan
Personal Project
October 2025

Typing Test TUI

Typing Test TUI is a Monkeytype-inspired typing trainer that runs entirely in the terminal. Built with Go, Cobra, Bubble Tea, and Lip Gloss, it delivers responsive layouts, multilingual datasets, and analytics so you can benchmark speed and accuracy without leaving your keyboard.

Go 1.25
Cobra
Bubble Tea
Lip Gloss
Terminal UI
Spaced Repetition
JSON
Makefile
Terminal
$ typing-test-tui --mode quote --language english
Quote Mode
Language: English · 16 words · 85 chars
╭────────────────────────────────────────────
─╮
// Go program to illustrate the↵
// use of an infinite loop↵
package main↵
import "fmt"↵
func main() {↵
for {↵
fmt.Printf("GeeksforGeeks")↵
}↵
}
╰────────────────────────────────────────────
─╯
Progress │ WPM │ Time
142/142 chars (100%) 47.8 00:28

✅ Completed in 00:28 · WPM 47.79

Press Enter for another quote or Ctrl+C to exit.

Project Overview

Typing Test TUI brings the polish of modern web-based typing trainers to the command line. It offers multiple practice modes, rich languages and code corpora, and immediate performance insights. The project emphasizes ergonomic CLI design, quick startup, and the ability to run entirely offline once installed.

Built with Cobra for flag parsing and command ergonomics, the app leans on Bubble Tea for stateful TUI interactions and Lip Gloss for theming. Datasets are stored locally as JSON, enabling rapid customization for personal languages, programming stacks, or team onboarding materials.

The TUI shares the same responsive layout across macOS, Linux, and Windows terminals, making it ideal for daily drills, coding bootcamps, or developer onboarding exercises.

Key Features

Performance Analytics

  • Tracks raw WPM, adjusted WPM, accuracy, and error types per session.
  • Highlights streaks, mistake density, and pacing for targeted improvement.
  • Exports structured JSON logs that open doors for personal dashboards.

Adaptive Practice

  • Toggle punctuation, numbers, and session duration with ergonomic flags.
  • Quickly swap languages or code corpora using normalized aliases.
  • Smart validation catches invalid combinations before the TUI launches.

Practice Modes & Datasets

Quote

Curated quotes and programming aphorisms keep longer-form passages engaging, perfect for accuracy drills.

Words

Fixed word-count sessions with optional punctuation and numbers provide focused sprints to dial in consistency.

Time

Open-ended, duration-based streams simulate live typing tests and capture sustained performance trends.

Language Coverage

Ships with curated datasets for English, Spanish, French, and Simplified Chinese, plus code samples across Go, Rust, JavaScript, and more.

Offline First

All corpora live within the repository. No network calls are required once installed, ensuring consistent performance on flights or secure environments.

Technical Implementation

State Management

Bubble Tea models orchestrate session state, keystroke events, timers, and view rendering. The architecture isolates mode logic inside dedicated packages for maintainability.

Config & Flags

Cobra commands normalize CLI flags, handle validation, and surface actionable error messages before launching the TUI. A shared configuration layer persists defaults across runs.

Rendering Pipeline

Lip Gloss powers color themes, responsive layouts, and focused prompts, while custom components render metrics, progress bars, and result summaries with high contrast.

Usage & Installation

Install via Go

go install github.com/neilsmahajan/typing-test-tui@latest

Build from Source

git clone https://github.com/neilsmahajan/typing-test-tui.git
cd typing-test-tui
make build
./bin/typing-test-tui --mode quote

Recommended Workflow

Use make run with ARGS to iterate on new datasets, and run make test plus make lint before contributing.

Performance & Results

20+

Curated code and language datasets

120s

Maximum timed session out of the box

~90 WPM

Personal best sustained over a week of testing

Terminal Walkthrough

Terminal
$ typing-test-tui --mode words --language english --word-count 50 --include-punctuation --include-numbers
Words Mode
Language: English · target 50 words · 287 chars
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─╮
More: consider, should take, but then around much against down early, as word. Help place, to large never in
will. Against these, against during use if what about "head" much. First good 367 program 547, of general
lead. Seem possible we 21 more while: those need end before eye through.
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─╯
Progress │ WPM │ Time
57/287 chars (20%) 36.9 00:14

Esc: blur focus • Tab: finish test • Ctrl+C: exit

Learning Outcomes

Systems Design

Crafted a modular architecture that separates CLI flag parsing, session orchestration, and rendering, improving test coverage and maintainability.

Developer Experience

Focused on instant feedback loops, ergonomic shortcuts, and human-friendly error messages inspired by popular typing platforms.

Community Ready

Documented contribution workflows, dataset extensions, and linting pipelines so others can adopt or fork the tool with minimal ramp-up.

Testing Discipline

Hardened parsing, timing, and metric computations with targeted unit tests to ensure correctness across practice modes.