diff
Show differences between local component copies and the latest registry versions. Syntax-highlighted side-by-side TUI.
Usage
npx @gentleduck/cli diff [components...]
npx @gentleduck/cli diff [components...]
Compares your local component source against the latest registry version. Default output is a syntax-highlighted side-by-side TUI; pass --gui false for plain text.
Options
| Flag | Description |
|---|---|
-c, --cwd <cwd> | Working directory |
-g, --gui | Force TUI mode (default when stdout is a TTY) |
-w, --workspace <path> | Target workspace |
Examples
# Diff a specific component
npx @gentleduck/cli diff button
# Diff all installed components
npx @gentleduck/cli diff
# Force TUI even in non-interactive shells (e.g. CI logs you'll page later)
npx @gentleduck/cli diff button --gui# Diff a specific component
npx @gentleduck/cli diff button
# Diff all installed components
npx @gentleduck/cli diff
# Force TUI even in non-interactive shells (e.g. CI logs you'll page later)
npx @gentleduck/cli diff button --guiWhat you see
The TUI renders three panels:
┌──── local ─────────────────┬──── registry ─────────────────┐
│ export function Button() { │ export function Button(props) {│
│ return <button /> │ return <button {...props} /> │
│ } │ } │
└────────────────────────────┴───────────────────────────────┘
[j/k] move [q] quit [u] update
Press u to launch update on the currently-focused component without leaving the TUI.
Common workflow
cli diff— see what's drifted from upstreamcli update <name>— pull changes via the merge TUI (preserves your local edits)cli diff <name>— verify the merge resolved correctly
Use in CI
For CI / scripts, diff exits with code 1 when there's a diff and 0 when in sync:
npx @gentleduck/cli diff --gui false || echo "drift detected"
npx @gentleduck/cli diff --gui false || echo "drift detected"