guidiff 0.2.2
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 +71 -0
- package/bin/guidiff.js +40 -0
- package/package.json +30 -0
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# guidiff
|
|
2
|
+
|
|
3
|
+
**Guided local code review.** A GitHub-like diff UI that runs on your machine,
|
|
4
|
+
with a reading guide that tells you where to start — and a blocking CLI that
|
|
5
|
+
returns your review straight to the AI session that launched it.
|
|
6
|
+
|
|
7
|
+
> guidiff = guide + diff
|
|
8
|
+
|
|
9
|
+
## Why
|
|
10
|
+
|
|
11
|
+
- Review AI-written code *before* it becomes a PR, in a UI your eyes already know.
|
|
12
|
+
- A reading guide orders the diff by importance: core changes first,
|
|
13
|
+
lockfile churn last.
|
|
14
|
+
- Launched from a Claude Code session, the review result (verdict + line comments)
|
|
15
|
+
lands back in that exact session — no copy-paste, no wrong-window mistakes.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g guidiff # or: npx guidiff / bunx guidiff
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Prebuilt binaries for macOS (arm64/x64) and Linux (x64/arm64). No Bun required.
|
|
24
|
+
|
|
25
|
+
Or build from source:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
git clone https://github.com/hatappi/guidiff && cd guidiff
|
|
29
|
+
bun install && bun run build:binary
|
|
30
|
+
mv guidiff ~/.local/bin/ # or anywhere on your PATH
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
A Homebrew package is planned.
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
guidiff # review uncommitted changes (working tree vs HEAD)
|
|
39
|
+
guidiff main feature # review a ref range
|
|
40
|
+
guidiff main..HEAD # range syntax works too
|
|
41
|
+
guidiff --guide g.json # attach a reading guide
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Exit codes: `0` submitted (result JSON on stdout) / `1` error / `2` cancelled.
|
|
45
|
+
stdout carries **only** the result JSON; all logs go to stderr.
|
|
46
|
+
|
|
47
|
+
## Claude Code plugin
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
/plugin marketplace add hatappi/guidiff
|
|
51
|
+
/plugin install guidiff@guidiff
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Then ask Claude: *"guidiff でレビューして"* / *"review this with guidiff"*.
|
|
55
|
+
The session generates a guide for its own changes, opens the UI, and acts on
|
|
56
|
+
your verdict and comments when you submit.
|
|
57
|
+
|
|
58
|
+
## Development
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
bun install
|
|
62
|
+
bun test packages/schema packages/cli && bun test --cwd packages/ui
|
|
63
|
+
bun packages/cli/src/index.ts . --no-open # run from source
|
|
64
|
+
bun run build:binary # single binary ./guidiff
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Release (maintainers)
|
|
68
|
+
|
|
69
|
+
1. Bump `version` in the root `package.json` and commit.
|
|
70
|
+
2. `npm login` (once) — publishing needs the npmjs.com `guidiff` org.
|
|
71
|
+
3. `bun run release --dry-run` to inspect the packages, then `bun run release`.
|
package/bin/guidiff.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
const { spawnSync } = require('node:child_process');
|
|
4
|
+
|
|
5
|
+
const PACKAGES = {
|
|
6
|
+
"darwin-arm64": "@guidiff/cli-darwin-arm64",
|
|
7
|
+
"darwin-x64": "@guidiff/cli-darwin-x64",
|
|
8
|
+
"linux-x64": "@guidiff/cli-linux-x64",
|
|
9
|
+
"linux-arm64": "@guidiff/cli-linux-arm64"
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const key = process.platform + '-' + process.arch;
|
|
13
|
+
const pkg = PACKAGES[key];
|
|
14
|
+
if (!pkg) {
|
|
15
|
+
console.error('guidiff: unsupported platform: ' + key);
|
|
16
|
+
console.error('Supported platforms: ' + Object.keys(PACKAGES).join(', '));
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let bin;
|
|
21
|
+
try {
|
|
22
|
+
bin = require.resolve(pkg + '/bin/guidiff');
|
|
23
|
+
} catch {
|
|
24
|
+
console.error('guidiff: binary package ' + pkg + ' is not installed.');
|
|
25
|
+
console.error('Reinstall guidiff without disabling optional dependencies.');
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const result = spawnSync(bin, process.argv.slice(2), { stdio: 'inherit' });
|
|
30
|
+
if (result.error) {
|
|
31
|
+
console.error('guidiff: failed to run binary: ' + result.error.message);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
if (result.signal) {
|
|
35
|
+
// Re-raise the child's fatal signal so callers see 128+n. On the POSIX
|
|
36
|
+
// platforms we ship, the self-directed signal is delivered before
|
|
37
|
+
// process.kill returns, so the exit below is never reached in this case.
|
|
38
|
+
process.kill(process.pid, result.signal);
|
|
39
|
+
}
|
|
40
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "guidiff",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Guided local code review — a GitHub-like diff UI with an AI reading guide",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"code-review",
|
|
7
|
+
"diff",
|
|
8
|
+
"git",
|
|
9
|
+
"cli",
|
|
10
|
+
"ai"
|
|
11
|
+
],
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/hatappi/guidiff.git"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://github.com/hatappi/guidiff#readme",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"bin": {
|
|
19
|
+
"guidiff": "bin/guidiff.js"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18"
|
|
23
|
+
},
|
|
24
|
+
"optionalDependencies": {
|
|
25
|
+
"@guidiff/cli-darwin-arm64": "0.2.2",
|
|
26
|
+
"@guidiff/cli-darwin-x64": "0.2.2",
|
|
27
|
+
"@guidiff/cli-linux-x64": "0.2.2",
|
|
28
|
+
"@guidiff/cli-linux-arm64": "0.2.2"
|
|
29
|
+
}
|
|
30
|
+
}
|