> Crysk 0.9.0 docs. Index of every page: https://crysk.dev/llms.txt

# Use Crysk locally

Install the Crysk CLI and review your current branch from your terminal.

At the end, Crysk has reviewed your current branch and written a report on your machine. Locally Crysk is an assistant: it never blocks a merge. To gate merges, use [GitHub Actions](https://crysk.dev/docs/quickstart-github-actions.md).

## Before you start

- **git**, and a repository with a branch that differs from its base branch.
- **Claude Code, logged in**: check with `claude --version`. Crysk runs your reviews through it.
- **The GitHub CLI, logged in** (`gh auth status`): only for `--pr` and `--post`.
- **OpenCode**: only if you choose OpenCode models.
- Crysk needs an `origin` remote in the repository.

## 1. Install

```bash
npm install -g crysk
```

Or install the standalone binary on macOS or Linux:

```bash
curl -fsSL https://raw.githubusercontent.com/cryskai/crysk/main/install.sh | bash
export PATH="$HOME/.crysk/bin:$PATH"
```

The installer edits your shell rc file, but only new shells read it: the `export` line makes `crysk` work in the shell you are in.

## 2. Check your setup

```bash
crysk doctor
```

Each line starts with `[✓]` or `[!]`. Fix `git` and `claude` if they are marked. The other warnings do not stop a review. `doctor` exits with 1 only when a check blocks reviews.

## 3. See the plan for free

On a branch with commits that are not on the base branch:

```bash
crysk review --dry-run
```

It prints the plan and runs nothing. You should see:

```text
╭─ crysk · review ─────────────────────────────────────────────────────────────╮
│ main..HEAD                                                                   │
│ ~/code/demo · 1 files  +1 −0                                                 │
╰──────────────────────────────────────────────────────────────────────────────╯

  AGENTS     reliability  claude:sonnet-latest always
             resilience   claude:sonnet-latest always
             logic        claude:sonnet-latest always
             security     claude:sonnet-latest always
             refuter      claude:opus-latest per severe finding
             summarizer  claude:haiku-latest always

  BASE       main → 667e255a93  (refs/remotes/origin/HEAD)
  RANGE      667e255a93 → 72b0dd1264  (merge base)
  ...
  ✓ size gate: pass — 1 effective line(s) in 1 file(s)

dry run: nothing was spawned and nothing was spent.
```

Not what you got? The working tree must be clean: commit or stash your changes, because every step reads your checkout. If it says there is no remote named `origin`, add one with `git remote add origin <url>`.

## 4. Run the review

```bash
crysk review
```

Crysk prints the plan again and asks you to confirm. The review uses your Claude plan quota, or your API key if you set that up. When it finishes, the terminal lists the findings and the run directory. That directory holds `report.md` (the readable report) and `findings.json`. Use `--out <dir>` to choose another directory outside the repository.

To review a pull request instead of your branch:

```bash
crysk review --pr 123
```

Without a number, `--pr` uses the pull request of the current branch. Add `--post` to publish the review as a comment on the pull request.

## Exit codes

| Code | Meaning |
|---|---|
| `0` | The review is complete, with or without findings. |
| `1` | No usable review: every step failed, or the review was skipped (for example by the size gate). |
| `2` | Usage error. |
| `3` | The review is incomplete: a step failed or time ran out. Run it again. |

Findings never change the exit code.

## Next steps

- **Add review instructions:** put a `REVIEW.md` at the repository root with what a reviewer cannot infer from the diff. If you create it with `crysk init`, replace the placeholder lines before reviewing: Crysk refuses the placeholder file.
- **Every command and flag:** the [CLI reference](https://crysk.dev/docs/local/cli.md).
