terminalreplay
v1.0.0
Published
Screen recording for developers — but terminal-native.
Maintainers
Readme
terminalreplay
Screen recording for developers — but terminal-native.
terminalreplay records live terminal sessions, preserves timing and ANSI output, replays them interactively, and exports polished artifacts for tutorials, onboarding, demos, bug reports, and README storytelling.
npx terminalreplay record
npx terminalreplay replay session.tr --cinematic
npx terminalreplay export session.tr --html
npx terminalreplay export session.tr --gif
npx terminalreplay export session.tr --videoWhy it exists
Most screen recorders capture pixels. terminalreplay captures the actual terminal story: commands, output, timing, and terminal behavior. That makes recordings lighter, easier to edit, and much better suited to developer education.
Features
| Capability | What you get |
| --- | --- |
| Native recording | Interactive shell capture via PTY with timing, ANSI colors, and resize events |
| Replay engine | Pause/play, speed control, seeking, cinematic playback |
| Export pipeline | Standalone HTML, animated GIF, MP4 via ffmpeg, and frame sequences |
| Editing tools | Trim, merge, convert to asciinema cast |
| Themes | cyberpunk, dracula, nord, matrix, github dark, hacker green |
| Developer polish | Commander CLI, spinners, branded terminal UX, modular TypeScript architecture |
Install
npm install -g terminalreplayor run ad hoc:
npx terminalreplay recordUsage
Record
terminalreplay record --output deploy.tr --title "Deploy walkthrough"Exit the spawned shell when you are done. The .tr file is plain JSON and easy to version, inspect, or transform.
Replay
terminalreplay replay deploy.tr --speed 1.25 --cinematicControls:
spacepause/play←/→seek+/-adjust speedqquit
Export
terminalreplay export deploy.tr --html --output replay.html
terminalreplay export deploy.tr --gif --output replay.gif --fps 18 --theme dracula
terminalreplay export deploy.tr --video --output replay.mp4 --music ambient.mp3MP4 export requires
ffmpegon your system path.
Editing and conversion
terminalreplay trim deploy.tr --from 1500 --to 12000 --output clip.tr
terminalreplay merge intro.tr deploy.tr --output story.tr
terminalreplay convert story.tr --output story.cast
terminalreplay themesDemo placeholders
docs/screenshots/player.pngdocs/screenshots/themes.pngexports/demo.gifexports/demo.mp4
Architecture
flowchart LR
A["Recorder (node-pty)"] --> B[".tr JSON recording"]
B --> C["Replay engine"]
B --> D["HTML exporter"]
B --> E["Frame renderer"]
E --> F["GIF exporter"]
E --> G["MP4 exporter (ffmpeg)"]
B --> H["Trim / merge / cast conversion"]The codebase is intentionally modular:
src/recorder.tscaptures sessionssrc/replay.tshandles interactive playbacksrc/render/*generates visual framessrc/export/*turns recordings into distributable artifactssrc/transform.tsprovides editing primitives
Roadmap
- xterm.js-powered browser playback with richer ANSI styling
- Chapter markers and annotations
- Theme authoring CLI
- Cloud share links
- Narration tracks and subtitle export
Contributing
Issues and pull requests are welcome. If you are changing the export pipeline, please include one sample .tr file and verify HTML + GIF output before submitting.
License
MIT
