diff-easy 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +88 -90
  2. package/package.json +10 -2
package/README.md CHANGED
@@ -1,16 +1,19 @@
1
1
  # diff-easy
2
2
 
3
- A local, browser-based **git diff viewer built for AI-agent workflows**. It runs a
4
- small web server on your machine (view it in any browser or Cmux's inline
5
- browser) and adds two things on top of a plain diff view:
6
-
7
- 1. **Filter by filename / type, and search within the diff.** Filter the file
8
- list by substring, by extension chips (`.ts`, `.tsx`, `.css`, …), and by change
9
- status; search diff _content_ across all files with highlight + next/prev.
10
- 2. **Review the diff produced by each AI-agent turn.** A capture hook snapshots
11
- your working tree at every Claude Code turn boundary, so you can browse a full
12
- timeline of turns and see exactly what each one changed with **live refresh**
13
- as the agent works.
3
+ A local, browser-based **git diff viewer built for AI-agent workflows**. Run one
4
+ always-on server and review diffs across **all your repos from a tabbed hub** — then
5
+ hand your review straight to a coding agent.
6
+
7
+ It does three things a plain diff viewer doesn't:
8
+
9
+ - **🗂️ One hub, every repo.** Open folders (or a GitHub PR) as **tabs** and switch
10
+ between them without spinning up a server per project.
11
+ - **💬 Comments you can hand to an agent.** Leave review comments on any line, then
12
+ **copy them as a ready-to-paste prompt** for Claude Code, Cursor, or any agent.
13
+ - **⏱️ A per-turn agent timeline.** Snapshot the working tree at every agent turn, so
14
+ you can replay exactly what each turn of a coding-agent session changed — live.
15
+
16
+ ![diff-easy hub — tabbed multi-repo diff view](https://raw.githubusercontent.com/saimageshvar/diff-easy/main/docs/images/hub-tabs.png)
14
17
 
15
18
  diff-easy is built on a vendored copy of [difit](https://github.com/yoshiko-pg/difit)
16
19
  (MIT). See [`NOTICE.md`](./NOTICE.md) for attribution.
@@ -18,125 +21,120 @@ diff-easy is built on a vendored copy of [difit](https://github.com/yoshiko-pg/d
18
21
  ## Install
19
22
 
20
23
  ```bash
21
- # from a clone of this repo
22
- corepack enable # provides pnpm
23
- pnpm install
24
- pnpm run build
25
- npm link # makes `diff-easy` available on your PATH (optional)
24
+ npm install -g diff-easy
26
25
  ```
27
26
 
28
- If you don't `npm link`, run it via `node dist/cli/index.js …` (or `pnpm start`).
27
+ Then run `diff-easy` inside any git repo, or start the hub (below). Requires Node 18+.
29
28
 
30
- ## Usage
29
+ ## The hub — review many repos from one place
31
30
 
32
- Run inside any git repository:
31
+ The hub is an always-on server. Point it at the folders that hold your repos, and it
32
+ discovers every git repo underneath them:
33
33
 
34
34
  ```bash
35
- diff-easy # default: ALL uncommitted changes (staged + unstaged) vs HEAD
36
- diff-easy working # unstaged changes only
37
- diff-easy staged # staged changes only
38
- diff-easy HEAD # the last commit (HEAD^..HEAD)
39
- diff-easy HEAD~3 HEAD # a commit range
40
- diff-easy --port 9100 # pick a port (handy with Cmux per-workspace ports)
35
+ diff-easy hub --root ~/code --root ~/work
41
36
  ```
42
37
 
43
- It prints a `http://localhost:<port>` URL and opens your browser. In **Cmux**,
44
- enable "open http/https in the cmux browser" (Settings) and the URL opens right in
45
- the inline browser pane or run `cmux browser open <url>`.
38
+ It opens a browser at `http://localhost:4966`. Pick a folder or paste a GitHub PR
39
+ URL and it opens as a **tab**. Open as many as you like and switch between them;
40
+ each tab remembers its own diff selection, filters, and comments.
46
41
 
47
- ### Filter & search
42
+ ![Open a folder or PR in the hub](https://raw.githubusercontent.com/saimageshvar/diff-easy/main/docs/images/hub-open.png)
48
43
 
49
- - **File list** (left): type in _Filter files…_, click extension chips to narrow by
50
- type, and use the status chips (Added / Modified / …) when more than one status
51
- is present.
52
- - **In-diff search**: press **Cmd/Ctrl+F** (or click the search icon). Enter steps
53
- to the next match, Shift+Enter the previous; toggle case sensitivity. Matches are
54
- highlighted across every file.
44
+ Because it's always on, most people run it once in the background on login. A handy
45
+ shell alias:
55
46
 
56
- ## Use from CMUX
47
+ ```bash
48
+ # ~/.bashrc / ~/.zshrc — start the hub once, in the background
49
+ alias dh='nohup diff-easy hub --root ~/code --root ~/work > ~/diff-easy-hub.log 2>&1 &'
50
+ ```
51
+
52
+ Now `dh` from anywhere brings the hub up (it's a no-op if already running). The port
53
+ defaults to `4966` (override with `--port` or `$DIFIT_HUB_PORT`).
54
+
55
+ ## Comments you can hand to an agent
56
+
57
+ Click any line to leave a comment — a code-review note, a fix request, a question.
58
+ Then **Copy All Prompt** turns every open comment into a single, structured prompt
59
+ (file, line, and your note) that you paste straight into a coding agent. Per-thread
60
+ **Copy Prompt** does the same for one comment.
61
+
62
+ ![Review comments with copy-to-agent prompt](https://raw.githubusercontent.com/saimageshvar/diff-easy/main/docs/images/comments.png)
63
+
64
+ This is the core loop diff-easy is built around: **review in the browser → copy →
65
+ paste to the agent → let it fix.** No integration or API keys — it's just your
66
+ clipboard.
67
+
68
+ ## Per-turn agent timeline
57
69
 
58
- Run this in a repo's CMUX workspace to open/close the hub scoped to that repo —
59
- in a browser split pane beside your terminal:
70
+ diff-easy can record what each turn of a coding-agent session changes, so you can
71
+ replay the session diff-by-diff. Install the capture hook once:
60
72
 
61
73
  ```bash
62
- diff-easy cmux toggle # open the split for $PWD if closed, close it if open
63
- diff-easy cmux open # just open (re-points the same pane; never closes)
64
- diff-easy cmux open --no-open # ensure the hub is up and print the URL
74
+ diff-easy init # every repo (writes to ~/.claude/settings.json)
75
+ diff-easy init --project # or just this repo (./.claude/settings.json)
65
76
  ```
66
77
 
67
- `toggle` starts the always-on hub if needed and opens the diff-easy split scoped
68
- via a `?repo=` deep-link; running it again closes that split. As the agent edits
69
- code, the diff (and the agent-turn timeline) update live beside your terminal.
78
+ This installs two Claude Code hooks that snapshot your **entire working tree** at each
79
+ turn boundary (capturing edits from both the Edit/Write tools _and_ shell commands).
80
+ Capture is decoupled from viewing turns are recorded whether or not the viewer is
81
+ open, so you can review a session after the fact.
70
82
 
71
- The hub is shared and shows one repo at a time, so toggling in another workspace
72
- re-points it to that repo. All three accept `--port <n>` (default `4966`; also
73
- honors `$DIFIT_HUB_PORT`).
83
+ In the viewer, the **review menu** lets you pick a session and step through its turns,
84
+ or stay on **Working tree** to auto-advance as the agent works:
74
85
 
75
- All accept `--port <n>` (default `4966`; also honors `$DIFIT_HUB_PORT`).
86
+ ![Agent turn timeline sessions and per-turn diffs](https://raw.githubusercontent.com/saimageshvar/diff-easy/main/docs/images/agent-turns.png)
76
87
 
77
- ## Per-turn diffs (Claude Code)
78
-
79
- Install the capture hooks once:
88
+ Snapshots are anchored under `refs/difit/snapshots` (so they survive `git gc` and never
89
+ touch your branches); each session keeps its most recent 50 turns. To wipe them:
80
90
 
81
91
  ```bash
82
- diff-easy init # installs into ~/.claude/settings.json (works in every repo)
83
- diff-easy init --project # or commit them to ./.claude/settings.json for a single repo
92
+ git update-ref -d refs/difit/snapshots && git gc --prune=now && rm -rf .difit-turns
84
93
  ```
85
94
 
86
- This adds two Claude Code hooks — `UserPromptSubmit` (turn start) and `Stop`
87
- (turn end). On each boundary, `diff-easy snapshot` records the **entire working
88
- tree** as a git snapshot (capturing edits from _both_ the Edit/Write tools and
89
- Bash commands like `sed`/`mv`). Snapshots are anchored under `refs/difit/snapshots`
90
- so they survive `git gc`, and turn metadata is written to `.difit-turns/log.json`.
91
- The hook is a no-op outside a git repo and never blocks the agent.
95
+ ## Filter & search
92
96
 
93
- Then, in the viewer, use the **Agent turns** dropdown (top toolbar) to:
97
+ Narrow the file list by glob, extension, or change status, and search diff _content_
98
+ across every file (**Cmd/Ctrl+F**) with match highlighting and next/prev.
94
99
 
95
- - pick **Working dir** for the live diff, or any **Turn N** to see exactly what that
96
- turn changed (its diff is `git diff <snapshotBefore> <snapshotAfter>`);
97
- - stay on **Live** to auto-advance to each new turn as the agent finishes it
98
- (powered by an SSE ping from the `Stop` hook).
100
+ ![Filter files and search within the diff](https://raw.githubusercontent.com/saimageshvar/diff-easy/main/docs/images/filter-search.png)
99
101
 
100
- Capture is decoupled from viewing: turns are recorded whether or not the viewer is
101
- open, so you can review after the fact.
102
+ Light and dark themes, font, and syntax highlighting live under the ⚙️ **Settings**
103
+ menu.
102
104
 
103
- ### Where it writes & data retention
105
+ ![Settings theme, font, and syntax highlighting](https://raw.githubusercontent.com/saimageshvar/diff-easy/main/docs/images/settings.png)
104
106
 
105
- - **`<repo>/.difit-turns/`** — `log.json` (turn metadata) and `server.json`
106
- (live-refresh port). Local-only and self-ignored from version control.
107
- - **`<repo>/.git`** — snapshot commits/trees/blobs, anchored by the single ref
108
- `refs/difit/snapshots`. Never touches your branches or normal history. Git
109
- deduplicates unchanged file content across snapshots.
110
- - **OS temp dir (`$TMPDIR`)** — a short-lived git index file per snapshot,
111
- deleted immediately (nothing persists there).
107
+ ## Quick single-repo mode
112
108
 
113
- **Retention:** each session keeps its **most recent 50 turns**
114
- (`MAX_TURNS_PER_SESSION`). Older turns are dropped from the log, and their
115
- snapshot commits stop being referenced by `refs/difit/snapshots`, so a routine
116
- `git gc` reclaims them — keeping `.git` bounded. To wipe all snapshots manually:
109
+ Don't need the hub? Run diff-easy directly in a repo to view one diff and exit:
117
110
 
118
111
  ```bash
119
- git update-ref -d refs/difit/snapshots && git gc --prune=now && rm -rf .difit-turns
112
+ diff-easy # all uncommitted changes vs HEAD (default)
113
+ diff-easy working # unstaged only
114
+ diff-easy staged # staged only
115
+ diff-easy HEAD~3 HEAD # a commit range
116
+ diff-easy --pr <url> # a GitHub PR
117
+ ```
118
+
119
+ ## Use from CMUX
120
+
121
+ Inside a CMUX workspace, toggle the hub in a browser split beside your terminal,
122
+ scoped to the current repo:
123
+
124
+ ```bash
125
+ diff-easy cmux toggle # open the split for this repo, or close it if open
120
126
  ```
121
127
 
128
+ Running it in another workspace re-points the shared hub to that repo.
129
+
122
130
  ## Develop
123
131
 
124
132
  ```bash
133
+ pnpm install
125
134
  pnpm run build # build CLI + client
126
- pnpm run build:cli # CLI only (type-checks the server/CLI)
127
- npx tsc --noEmit -p tsconfig.json # type-check the client
128
135
  pnpm test # run tests
129
136
  ```
130
137
 
131
- Key diff-easy additions over difit:
132
-
133
- - `src/client/components/FileList.tsx` — extension/status filter chips
134
- - `src/client/hooks/useDiffSearch.ts`, `src/client/components/DiffSearch.tsx` —
135
- in-diff search (CSS Custom Highlight API)
136
- - `src/cli/turns.ts`, `src/utils/turnLog.ts` — `snapshot` / `init` commands + log
137
- - `src/client/hooks/useTurns.ts`, `src/client/components/TurnTimeline.tsx` — turn UI
138
- - `src/server/server.ts` — `/api/turns`, `/events/turn-complete`, `server.json`
139
-
140
138
  ## License
141
139
 
142
140
  MIT — see [`LICENSE`](./LICENSE) and [`NOTICE.md`](./NOTICE.md).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "diff-easy",
3
- "version": "0.1.0",
4
- "description": "A local git diff viewer for AI-agent workflows: filter by file/type, search within diffs, and review the diff produced by each agent turn. Built on difit.",
3
+ "version": "0.1.1",
4
+ "description": "A local git diff viewer for AI-agent workflows: review many repos from one tabbed hub, copy line comments as ready-to-paste agent prompts, and replay the diff of each agent turn. Built on difit.",
5
5
  "keywords": [
6
6
  "cli",
7
7
  "code-review",
@@ -13,8 +13,16 @@
13
13
  "review",
14
14
  "tailwind"
15
15
  ],
16
+ "homepage": "https://github.com/saimageshvar/diff-easy#readme",
17
+ "bugs": {
18
+ "url": "https://github.com/saimageshvar/diff-easy/issues"
19
+ },
16
20
  "license": "MIT",
17
21
  "author": "Sai Mageshvar",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/saimageshvar/diff-easy.git"
25
+ },
18
26
  "bin": {
19
27
  "diff-easy": "dist/cli/index.js"
20
28
  },