Skip to content

Commit a1e6eea

Browse files
committed
docs: rewrite README with motivation and concise usage
Adds a motivation section, install instructions, a note about the 300-file gh api cap, and clarifies that UI changes are persisted to localStorage and override config.toml on subsequent loads.
1 parent 00c8483 commit a1e6eea

1 file changed

Lines changed: 52 additions & 25 deletions

File tree

README.md

Lines changed: 52 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,86 @@
11
# diffs
22

3-
`diffs` is a small Go CLI that serves an embedded React diff review UI.
3+
Fast, beautiful diffs on the Go.
44

5-
It has two main modes:
5+
<!-- screenshot goes here -->
66

7-
- Local working tree: `diffs local` opens `http://127.0.0.1:3433/local` and refreshes staged, unstaged, and untracked changes from filesystem events.
8-
- Pull request review: `diffs pr https://github.com/org/repo/pull/123` opens the same UI backed by `gh api`.
7+
## Motivation
98

10-
## Build
9+
`diffs` is a local-first CLI in a single binary. Inspired by [DiffsHub](https://diffshub.com) from [pierre.computer](https://pierre.computer/), it brings a calmer review experience to your working tree and GitHub pull request.
1110

12-
```sh
13-
pnpm install
14-
pnpm build
15-
```
11+
## Install
1612

17-
The build compiles the web UI into `internal/webassets/dist`, embeds that generated bundle into the Go binary, and writes the final CLI binary.
13+
Download a pre-built binary from the [releases page](https://github.com/imfing/diffs-cli/releases), or build from source (see below).
1814

1915
## Usage
2016

17+
Run from any git repository:
18+
2119
```sh
2220
diffs
23-
diffs local
24-
diffs local --host localhost --port 4321 --dir /path/to/repo
25-
diffs pr /org/repo/pull/123
21+
```
22+
23+
This opens `http://127.0.0.1:3433/local` and reloads when files change.
24+
25+
Review a GitHub pull request (requires the [GitHub CLI](https://cli.github.com)):
26+
27+
```sh
2628
diffs pr https://github.com/org/repo/pull/123
29+
```
30+
31+
Common flags:
32+
33+
```sh
34+
diffs local --port 4321 --dir /path/to/repo
2735
diffs pr --github-host github.example.com /org/repo/pull/123
2836
```
2937

30-
The GitHub PR path relies on the GitHub CLI being authenticated for the target host.
38+
### Large pull requests
39+
40+
The `pr` command fetches the diff via `gh api`, which GitHub caps at 300 changed files. For larger PRs, clone the repo and review with `diffs local` after checking out the PR branch:
41+
42+
```sh
43+
gh pr checkout 123
44+
diffs local
45+
```
3146

3247
## Configuration
3348

34-
On startup, `diffs` attempts to read `~/.config/diffs/config.toml`. Missing config is ignored.
49+
Optional. `diffs` reads `~/.config/diffs/config.toml` on startup:
3550

3651
```toml
3752
[ui]
3853
color_scheme = "system" # system, light, dark
39-
diff_theme = "github" # pierre, github, dark-plus, light-plus, one-dark-pro, one-light, monokai, night-owl, tokyo-night
54+
diff_theme = "github" # github, dark-plus, light-plus, one-dark-pro, ...
4055
diff_style = "split" # split, unified
4156
word_wrap = false
4257
line_numbers = true
4358
line_backgrounds = true
4459
```
4560

46-
## Local comments
61+
The file sets initial defaults only. Once you change a setting in the UI it is saved to the browser's `localStorage` and takes precedence over `config.toml` on subsequent loads.
62+
63+
## Comments
64+
65+
Review comments are stored in `.diffs/comments.json` at the repo root. The folder is git-ignored by default.
66+
67+
```sh
68+
diffs comments add --file web/src/App.tsx --line 42 --body "Check this"
69+
diffs comments list
70+
diffs comments reply <thread-id> --body "Updated"
71+
diffs comments resolve <thread-id>
72+
diffs comments reopen <thread-id>
73+
```
74+
75+
Pass `--dir /path/to/repo` to target a different repository.
4776

48-
Local review comments are stored in `.diffs/comments.json` at the git repository root. The `.diffs/` directory is ignored by default, so comments stay local unless you intentionally share that file.
77+
## Build from source
78+
79+
Requires Go 1.26+ and pnpm.
4980

5081
```sh
51-
diffs comments list --dir .
52-
diffs comments list --json --dir .
53-
diffs comments add --dir . --file web/src/App.tsx --line 42 --body "Check this"
54-
diffs comments reply THREAD_ID --dir . --body "Updated note"
55-
diffs comments resolve THREAD_ID --dir .
56-
diffs comments reopen THREAD_ID --dir .
82+
pnpm install
83+
pnpm build
5784
```
5885

59-
Use `--dir /path/to/repo` with any `comments` command to target another repository.
86+
The binary is written to `bin/diffs`.

0 commit comments

Comments
 (0)