Introduction
viddy is a terminal tool that repeatedly executes a command and displays its output, similar to the classic Unix watch utility. It adds diff highlighting between runs, a time-travel mode that lets you scroll back through previous outputs, and a built-in pager for inspecting large results — all with a clean TUI.
What viddy Does
- Runs any shell command at a configurable interval and displays live output
- Highlights additions, deletions, and changes between consecutive runs
- Stores output history and lets you scroll backward through past snapshots
- Supports pager mode for searching and scrolling within a single output frame
- Provides both precise (character-level) and line-level diff modes
Architecture Overview
viddy is a single Go binary that spawns the target command in a subshell on each tick. It captures stdout and stores each snapshot in an in-memory ring buffer. A diff engine compares the current snapshot to the previous one and annotates changed regions. The TUI layer (built on tcell) renders the annotated output and handles keyboard navigation for paging, searching, and time travel.
Self-Hosting & Configuration
- Install via Homebrew, apt, Nix, or
go install— single binary with no dependencies - Set the refresh interval with
-n(supports sub-second values like0.5) - Enable diff highlighting with
-d(line-level) or--differences=precise(character-level) - Activate time-travel mode with
-tto browse previous output snapshots - Use shell aliases to replace
watchglobally:alias watch=viddy
Key Features
- Character-level and line-level diff highlighting between command runs
- Time-travel mode stores history and lets you scrub backward and forward
- Sub-second refresh intervals for monitoring fast-changing outputs
- Built-in pager with search (/) and scroll for large outputs
- Single static binary with zero runtime dependencies
Comparison with Similar Tools
- watch — Classic Unix utility, no diff highlighting or history playback
- entr — Re-runs commands when files change, not on a timer
- hwatch — Rust-based watch alternative with diff mode but no time travel
- loop — Minimal command repeater, no TUI or diff features
- wtfutil — Dashboard-style terminal monitoring, different use case
FAQ
Q: Can viddy replace the standard watch command?
A: Yes. It is a drop-in replacement that accepts the same -n interval flag and adds diff, pager, and time-travel features.
Q: How far back can time travel go? A: viddy keeps output history in memory for the duration of the session. There is no fixed limit beyond available RAM.
Q: Does viddy support color output from commands? A: Yes. It preserves ANSI color codes from the watched command and overlays diff highlights on top.
Q: How do I search within the output?
A: Press / to enter search mode, type a query, and press Enter. Use n and N to navigate matches.