|
| 1 | +# TAGLINE |
| 2 | + |
| 3 | +Live Git-style diff feed of file edits as they happen |
| 4 | + |
| 5 | +# TLDR |
| 6 | + |
| 7 | +Watch the **current Git repository** and print each edit as a unified diff |
| 8 | + |
| 9 | +```livediff``` |
| 10 | + |
| 11 | +Show only the **filename, time, and changed lines** (no hunk headers or context) |
| 12 | + |
| 13 | +```livediff --compact``` |
| 14 | + |
| 15 | +The same compact view with the **short flag** |
| 16 | + |
| 17 | +```livediff -c``` |
| 18 | + |
| 19 | +Disable **ANSI colors** when logging or piping |
| 20 | + |
| 21 | +```NO_COLOR=1 livediff``` |
| 22 | + |
| 23 | +# SYNOPSIS |
| 24 | + |
| 25 | +**livediff** [**-c** | **--compact**] [**-h** | **--help**] |
| 26 | + |
| 27 | +# PARAMETERS |
| 28 | + |
| 29 | +**-c**, **--compact** |
| 30 | +> Print only the path, a timestamp, and the added or removed lines. Omits the `diff --git` header, `---`/`+++` paths, hunk headers, and unchanged context. |
| 31 | +
|
| 32 | +**-h**, **--help** |
| 33 | +> Print usage and exit. |
| 34 | +
|
| 35 | +# KEYS |
| 36 | + |
| 37 | +When stdin is a terminal, **livediff** puts it in raw mode so single keypresses are read immediately. |
| 38 | + |
| 39 | +**q** or **Ctrl-C** |
| 40 | +> Stop watching and exit. |
| 41 | +
|
| 42 | +**c** |
| 43 | +> Clear the terminal (CSI erase display and home cursor). |
| 44 | +
|
| 45 | +# ENVIRONMENT |
| 46 | + |
| 47 | +**NO_COLOR** |
| 48 | +> When set to any non-empty value, ANSI color codes are omitted. Color is also off when stdout is not a terminal. |
| 49 | +
|
| 50 | +# DESCRIPTION |
| 51 | + |
| 52 | +**livediff** watches the Git work tree of the current directory and prints a unified diff for every file that changes after it starts. Edits from a coding agent, an editor, or any other process show up the same way: added lines in green, removed lines in red, with three lines of context in the default view. Each change is shown once, as a streaming feed rather than a full-screen TUI. |
| 53 | + |
| 54 | +At startup it records the contents of every path returned by `git ls-files --cached --others --exclude-standard` (tracked files and untracked files that are not ignored). It then polls that list every 200 milliseconds, comparing size, mtime, and bytes. New files, deletions, and content edits each produce a diff; binary files (NUL in the first 8 KiB) are reported as changed without a text hunk. Only edits that happen after **livediff** is running appear: the initial snapshot is silent. |
| 55 | + |
| 56 | +The current directory must be inside a Git work tree (`git rev-parse --is-inside-work-tree`). Git itself is the only runtime dependency. |
| 57 | + |
| 58 | +# CAVEATS |
| 59 | + |
| 60 | +The command name **livediff** is also used by an unrelated Rust TUI (`cargo install livediff`, Homebrew tap `socket7/tap/livediff`) that takes a path argument and opens a full-screen viewer. This page documents the Go streaming CLI from **stagas**. |
| 61 | + |
| 62 | +**livediff** polls on a 200 ms timer; it does not use inotify or FSEvents. Very large work trees keep file contents in memory. Ignored paths, and files that are neither tracked nor untracked-but-not-ignored, are never shown. Changes made before the process starts are not replayed. |
| 63 | + |
| 64 | +# HISTORY |
| 65 | + |
| 66 | +**livediff** is a small Go program by **stagas**, released under the **MIT License** in **2026**. |
| 67 | + |
| 68 | +# SEE ALSO |
| 69 | + |
| 70 | +[git-diff](/man/git-diff)(1), [git](/man/git)(1), [gitwatch](/man/gitwatch)(1), [watch](/man/watch)(1), [delta](/man/delta)(1), [diff](/man/diff)(1) |
| 71 | + |
| 72 | +# RESOURCES |
| 73 | + |
| 74 | +```[Source code](https://github.com/stagas/livediff)``` |
| 75 | + |
| 76 | +<!-- verified: 2026-09-15 --> |
0 commit comments