# Knuh: publish a code review and share the link

Knuh puts a [Hunk](https://www.hunk.dev) code review online at https://knuh.dev. You publish a diff, get a link, and give it to the user. Anyone with the link can read the review and comment; notes appear live for everyone on it.

## 1. Make sure `knuh` works

Run `knuh --help`. If the command is missing, install it:

```sh
curl -fsSL https://knuh.dev/install.sh | sh
```

It needs git, curl, Node 22 or newer, and SSH access to the private repository github.com/sruon/knuh. It downloads a prebuilt Hunk for Linux (x64, arm64), Apple silicon Macs and Windows x64; elsewhere it also needs Bun 1.4 or newer. On Windows, run it and `knuh` in Git Bash. If it stops on one of those, tell the user what it printed. If `knuh` is still not found afterwards, run it as `~/.local/bin/knuh`.

The installer also installs the `knuh` agent skill (for Claude Code, Codex and other agents that load skills). With it, the user only has to ask for a Knuh link; the skill loads this page. If `knuh` was already installed but the skill is missing, add it with:

```sh
npx skills add sruon/knuh -g --skill knuh
```

## 2. Publish

From the repository root, pick the command that matches what the user wants to see:

```sh
knuh diff main...HEAD    # the current branch against its base (use the repository's base branch)
knuh diff                # uncommitted work
knuh show <commit>       # one commit
```

It prints the share link on stdout. Give the user that link.

Run the same command again after more changes: it updates the same link instead of making a new one.

## 3. Explain your changes (optional, encouraged)

Leave notes on the lines that need explaining:

```sh
knuh review --json       # the published files and hunks, to pick lines from
knuh comment add --file <path> --new-line <n> --summary "<what>" --rationale "<why>" --author <your name>
knuh comment add --reply-to <comment id> --summary "<answer>" --author <your name>
knuh comment list        # every note, including the user's replies
```

The line must be inside a changed hunk. Use `--old-line <n>` for a removed line.

## If you know Hunk

Knuh hosts a Hunk review online; it is not a live Hunk session.

- `knuh comment ...` and `knuh review` take the same flags as `hunk session comment ...` and `hunk session review` and answer the same way: replace `hunk session` with `knuh`.
- Nothing else from `hunk session` exists here (navigating, focus, reload, marks), and `hunk session` itself cannot reach a Knuh review. Do not use the `hunk-review` skill for it.
- `knuh` runs Hunk itself to build the review. There is no Hunk window to open or keep running.

## Limits and errors

- The link is the only access control. Give it only to the user.
- Reviews are temporary: they last until the server restarts, and at most 90 days.
- 429 Too Many Requests: one new review per minute per address. Wait a minute and retry. Updating an existing link is not limited.
- 413 Request Entity Too Large: the review is over 10 MB. Publish less, for example only some paths: `knuh diff main...HEAD -- src/`.
- "This service runs Hunk review protocol X, but the review came from protocol Y": the local Knuh is out of date. Run `knuh update`, then publish again.
