Sarah's Forge.Dev
← All Projects
DiffTerm@SarahRoseLives:~
DiffTerm
A Terminal/CLI Diff Checker
★ 0   🍴 0
View on GitHub

✨ DiffTerm

DiffTerm is a terminal-based, side-by-side text diff tool designed for developers who work in the terminal—especially those collaborating with AI.
I created DiffTerm after noticing that AI-generated code often contains subtle mistakes or deviations from instructions. With DiffTerm, you can instantly compare two text blocks and visually spot changes at a glance—making AI-assisted coding safer, faster, and more reliable.

Screenshot


🚩 Why DiffTerm?

When coding in the terminal with AI, it's common to get code suggestions or completions that aren't exactly what you intended.
DiffTerm lets you:

  • Instantly paste and compare original and AI-generated code.
  • See additions and deletions with clear color highlights, right in your terminal.
  • Quickly verify if the AI followed your instructions, line by line.

✨ Features

  • Side-by-side Editing:
    Two panes for "Original" and "Updated" text, each with live line counting.
  • Live Diff Visualization:
    The bottom panel instantly shows the diff, with removed and added text.
  • Intuitive Controls:
    • TAB: Switch panes
    • Delete: Clear both panes and diff
    • Ctrl+C or Esc: Exit
  • Mouse Support:
    Full mouse and keyboard interaction.
  • Paste Support:
    Paste large chunks of text with ease.
  • Legend:
    Always-visible color legend for clarity.

🎨 How Diff Colors Display

  • Red text = Removed text
  • Green text = Added text

(If your Markdown viewer doesn’t support color, you’ll see regular text. In the terminal, colors are always shown.)


🚀 Getting Started

Prerequisites

  • Go 1.19+ (or newer)

Install dependencies

go get github.com/rivo/tview
go get github.com/gdamore/tcell/v2
go get github.com/sergi/go-diff/diffmatchpatch

Build & Run

go run main.go

or

go build -o diffterm && ./diffterm

🖥️ Usage

  1. Type or paste text into the "Original" and "Updated" panes.
  2. See differences live in the bottom panel.
  3. Use TAB to switch focus, Delete to clear, Ctrl+C/Esc to quit.

🖼️ Screenshot

DiffTerm Terminal Screenshot


🛠️ Powered By

Developer Updates

Loading updates...