@kud/revu-cli 1.0.0

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 (3) hide show
  1. package/README.md +50 -0
  2. package/bin/revu.js +36 -0
  3. package/package.json +48 -0
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ <p align="center">
2
+ <img src="assets/revu-logo.png" width="120" alt="revu logo" />
3
+ </p>
4
+
5
+ # revu
6
+
7
+ Interactive terminal diff reviewer. Annotate diffs, export reviews to Markdown.
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ npm install -g @kud/revu-cli
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```sh
18
+ # Review staged/unstaged changes in the current repo
19
+ revu
20
+
21
+ # Review a specific file
22
+ revu src/foo.ts
23
+
24
+ # Review all commits between a branch and HEAD (PR mode)
25
+ revu --against main
26
+ ```
27
+
28
+ ## Keys
29
+
30
+ | Key | Action |
31
+ | ------------ | ----------------------------------- |
32
+ | `↑↓` / `j k` | Move cursor |
33
+ | `shift+↑↓` | Select range |
34
+ | `↵` | Annotate line / range |
35
+ | `d` | Delete annotation |
36
+ | `] [` | Next / prev hunk |
37
+ | `c C` | Next / prev annotation |
38
+ | `n p` | Next / prev file |
39
+ | `{ }` | Scroll annotation preview |
40
+ | `←` | Back to file tree |
41
+ | `e` | Export annotations to Markdown |
42
+ | `s` | Settings (theme, view, output file) |
43
+ | `q` | Quit |
44
+
45
+ ## Config
46
+
47
+ Press `s` inside revu to open settings. Changes are saved automatically:
48
+
49
+ - **Global** (theme, view mode) → `~/.config/revu/settings.json`
50
+ - **Per-repo** (output filename) → `revu.json` in the repo root
package/bin/revu.js ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from "module"
3
+ import { spawnSync } from "child_process"
4
+
5
+ const require = createRequire(import.meta.url)
6
+
7
+ const PACKAGES = {
8
+ "darwin-arm64": "@kud/revu-cli-darwin-arm64",
9
+ "darwin-x64": "@kud/revu-cli-darwin-x64",
10
+ "linux-x64": "@kud/revu-cli-linux-x64",
11
+ "linux-arm64": "@kud/revu-cli-linux-arm64",
12
+ }
13
+
14
+ const platform = `${process.platform}-${process.arch}`
15
+ const pkg = PACKAGES[platform]
16
+
17
+ if (!pkg) {
18
+ console.error(`revu-cli: unsupported platform: ${platform}`)
19
+ process.exit(1)
20
+ }
21
+
22
+ let binaryPath
23
+ try {
24
+ binaryPath = require.resolve(`${pkg}/revu-bin`)
25
+ } catch {
26
+ console.error(
27
+ `revu-cli: could not find binary for ${platform}. Try reinstalling revu-cli.`,
28
+ )
29
+ process.exit(1)
30
+ }
31
+
32
+ const result = spawnSync(binaryPath, process.argv.slice(2), {
33
+ stdio: "inherit",
34
+ windowsHide: true,
35
+ })
36
+ process.exit(result.status ?? 1)
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@kud/revu-cli",
3
+ "version": "1.0.0",
4
+ "description": "Interactive terminal diff reviewer",
5
+ "module": "index.ts",
6
+ "type": "module",
7
+ "bin": {
8
+ "revu": "bin/revu.js"
9
+ },
10
+ "files": [
11
+ "bin/"
12
+ ],
13
+ "scripts": {
14
+ "dev": "bun --hot index.ts",
15
+ "start": "bun index.ts",
16
+ "build": "bun build --compile --minify index.ts --outfile revu-bin",
17
+ "build:darwin-arm64": "bun build --compile --minify --target=bun-darwin-arm64 index.ts --outfile npm-packages/darwin-arm64/revu-bin",
18
+ "build:darwin-x64": "bun build --compile --minify --target=bun-darwin-x64 index.ts --outfile npm-packages/darwin-x64/revu-bin",
19
+ "build:linux-x64": "bun build --compile --minify --target=bun-linux-x64 index.ts --outfile npm-packages/linux-x64/revu-bin",
20
+ "build:linux-arm64": "bun build --compile --minify --target=bun-linux-arm64 index.ts --outfile npm-packages/linux-arm64/revu-bin",
21
+ "build:all": "bun run build:darwin-arm64 && bun run build:darwin-x64 && bun run build:linux-x64 && bun run build:linux-arm64"
22
+ },
23
+ "optionalDependencies": {
24
+ "@kud/revu-cli-darwin-arm64": "1.0.0",
25
+ "@kud/revu-cli-darwin-x64": "1.0.0",
26
+ "@kud/revu-cli-linux-x64": "1.0.0",
27
+ "@kud/revu-cli-linux-arm64": "1.0.0"
28
+ },
29
+ "devDependencies": {
30
+ "@types/bun": "latest"
31
+ },
32
+ "peerDependencies": {
33
+ "typescript": "^5"
34
+ },
35
+ "dependencies": {
36
+ "@opentui/core": "0.1.95",
37
+ "@opentui/core-darwin-arm64": "0.1.96",
38
+ "@opentui/core-linux-arm64": "0.1.96",
39
+ "@opentui/core-linux-x64": "0.1.96"
40
+ },
41
+ "license": "MIT",
42
+ "keywords": [
43
+ "diff",
44
+ "review",
45
+ "cli",
46
+ "tui"
47
+ ]
48
+ }