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.
- package/README.md +88 -90
- 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**.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
+

|
|
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
|
-
|
|
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
|
-
|
|
27
|
+
Then run `diff-easy` inside any git repo, or start the hub (below). Requires Node 18+.
|
|
29
28
|
|
|
30
|
-
##
|
|
29
|
+
## The hub — review many repos from one place
|
|
31
30
|
|
|
32
|
-
|
|
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
|
|
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
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
42
|
+

|
|
48
43
|
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
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
|
+

|
|
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
|
-
|
|
59
|
-
|
|
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
|
|
63
|
-
diff-easy
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
72
|
-
|
|
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
|
-
|
|
86
|
+

|
|
76
87
|
|
|
77
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
+

|
|
99
101
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
Light and dark themes, font, and syntax highlighting live under the ⚙️ **Settings**
|
|
103
|
+
menu.
|
|
102
104
|
|
|
103
|
-
|
|
105
|
+

|
|
104
106
|
|
|
105
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
4
|
-
"description": "A local git diff viewer for AI-agent workflows:
|
|
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
|
},
|