Skip to content

aymenhmaidiwastaken/cli-recorder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLI Recorder

Record, play back, and export your terminal sessions — straight from the command line.

Node 18+ Cross-platform Asciicast v2 1 dependency MIT License

CLI Recorder demo — terminal session recording and playback


CLI Recorder is a terminal session recorder that captures everything you do in your terminal. Install it globally, run rec from any directory, and use your terminal normally. Every keystroke, command output, and color is saved to a standard asciicast v2 file. Play recordings back in the terminal, convert them to GIF or MP4, and manage everything from an interactive dashboard.

Features

  • Record terminal sessions with full color and formatting support
  • Play back recordings directly in the terminal with speed control
  • Export to GIF with a single command (via agg)
  • Export to MP4 for sharing anywhere (via agg + ffmpeg)
  • Interactive dashboard to browse, play, and export recordings
  • Themes — switch between Default, Dracula, Monokai, Ocean, Solarized, and Rosé Pine
  • Mid-recording dashboard — type dashboard during a recording to manage files without interrupting the session
  • Cross-platform — works on Windows, macOS, and Linux
  • Asciicast v2 compatible — works with asciinema, agg, svg-term-cli, and more

Installation

git clone https://github.com/aymenhmaidiwastaken/cli-recorder.git
cd cli-recorder
npm install
npm link

rec is now available globally from any directory.

Usage

Record

rec                              # Record to recording.cast
rec demo.cast                    # Record to a specific file
rec --shell bash demo.cast       # Record using a specific shell
rec --shell powershell demo.cast # Record using PowerShell

Use your terminal normally while recording. Type exit or press Ctrl+D to stop.

Play Back

rec play demo.cast               # Play a recording
rec play --speed 2 demo.cast     # Play at 2x speed
rec play --max-wait 1 demo.cast  # Cap gaps between frames to 1s

Inspect

rec info demo.cast
  File:      demo.cast
  Size:      2.4 KB
  Duration:  8.3s
  Terminal:  90x30
  Events:    47 (47 output)
  Shell:     /bin/bash
  Recorded:  3/25/2026, 11:01:18 PM

Export to GIF

rec gif demo.cast                # Convert to demo.gif
rec gif --speed 1.5 demo.cast    # Convert with speed multiplier
rec gif demo.cast output.gif     # Custom output path

Requires agg (cargo install agg). The active theme controls GIF colors — the default theme produces a clean black background with white text.

Export to MP4

Available through the dashboard. Requires agg + ffmpeg.

Dashboard

rec dashboard

The interactive dashboard lets you:

  • Start new recordings
  • Browse all .cast files in the current directory
  • View recording info (duration, size, terminal dimensions)
  • Play back recordings
  • Export to GIF or MP4
  • Switch themes

Navigate with arrow keys, Enter to select, q to go back.

You can also type dashboard during an active recording session. The dashboard opens without being captured in the recording, and the session resumes when you exit.

Themes

Switch between 6 built-in themes from the dashboard:

Theme Description
Default Clean black terminal with white text
Dracula Dark purple palette
Monokai Classic warm colors
Ocean Cool blue tones
Solarized Ethan Schoonover's Solarized Dark
Rosé Pine Soft pink and muted tones

Themes apply to both the dashboard UI and GIF/MP4 exports. Your choice is saved to ~/.rec/config.json.

Output Format

CLI Recorder outputs standard asciicast v2 files (.cast). These are compatible with:

  • asciinema — upload and share recordings
  • agg — convert to GIF
  • svg-term-cli — convert to SVG
  • Any tool that reads asciicast v2

How It Works

CLI Recorder spawns a real PTY shell using node-pty and captures all terminal output with timestamps. Your terminal looks and behaves exactly the same — same colors, same prompt, same shell. The only difference is everything gets written to a .cast file in the background.

CLI Reference

rec [file]                Record a session (default: recording.cast)
rec play <file>           Play back a recording
rec gif <file> [out]      Convert recording to GIF (requires agg)
rec info <file>           Show recording details
rec dashboard             Interactive dashboard
rec --help                Show help

Options:
  --shell <path>          Shell to use (default: system shell)
  --speed <n>             Playback / GIF speed multiplier (default: 1)
  --max-wait <sec>        Max delay between frames in playback (default: 2)

License

MIT

Releases

No releases published

Packages

 
 
 

Contributors