typecat

A C++ program that displays text from a file or stdin in a fun way - mimicking realistic manual typing. It even makes mistakes!

release date: 2026-01-04

view on GitHub

about

typecat is a fast, lightweight and highly configurable command-line tool written in C++ (C++17) that displays text as if it were being typed in real time. It reads from files, stdin (pipes) or direct text arguments and renders output with realistic timing, optional typos, ANSI escape handling and line numbering.
example
It’s a fun and useful alternative to classic cat and modern bat/batcat - great for demos, screencasts, teaching, script testing or just spicing up your terminal output. Portable and easy to build on Linux, Termux and other Unix-like systems.

features

Features:
  • Realistic character-by-character typing simulation with configurable speed.
  • Optional random typos with adjustable probability.
  • Proper handling of ANSI escape sequences (render colors) or textual representation of escapes.
  • Line numbers (dimmed) and continued line prefix support.
  • Read from file, stdin (pipe) or -t/--text inline arguments.
  • Binary input detection with --show-all override.
  • Audible bell on errors (optional).
  • Robust, deterministic POSIX signal handling (SIGINT, SIGTERM, SIGQUIT, SIGHUP, SIGWINCH).
  • Debug mode for runtime diagnostics.
  • Minimal external dependencies — just a C++17 toolchain.
Options:
Option Description
-s, --speed <1-100>Typing speed (default 50). Higher = faster / shorter delays.
-m, --mistakes [1-100]Enable random typos. Optionally give chance as percent (default 10).
-c, --colorInterpret ANSI escape sequences (show colors).
-e, --print-escapesPrint ANSI escapes textually as \e[...] instead of interpreting them.
-b, --beepEmit BEL on error conditions.
-t, --text <string>Add a text line to display (multiple -t allowed).
-a, --show-allForce showing input even if it looks binary.
-n, --line-numbersPrepend dimmed line numbers.
-r, --allow-resizeIgnore SIGWINCH (allow terminal resize while typing).
--debugPrint debug info to stderr (useful for troubleshooting).
-h, --helpShow help and exit.
-v, --versionShow version and exit.
--codesShow list of exit codes and signal handling info.

compatibility

  • Compatible with any UNIX-like system and distribution.
  • Written in C++17 and requires minimal dependencies.