Skip to content

Getting started

Status: Kerpeten is at an early stage. Today it reviews on your machine and prints the findings. It does not post the review to a merge request yet.

  1. Install Kerpeten:

    Terminal window
    npm install -g kerpeten

    It also needs ripgrep (rg) on your PATH; the models search your code with it.

  2. Run kerpeten init inside the repository you want to review:

    Terminal window
    cd /path/to/your-repository
    kerpeten init

    It asks for the provider and the model of the reviewer and of the judge and for the language of the review comments. Then it writes .kerpeten.yml to the root of the repository and tells what is still missing: ripgrep, a key or a sign-in.

  3. Give Kerpeten the key of your provider, or sign in with kerpeten auth login when you chose your ChatGPT plan. Put your key in the place of <your key>:

    Terminal window
    export ANTHROPIC_API_KEY="<your key>"
  4. Commit your work, then run the review from inside the repository:

    Terminal window
    kerpeten review --dry-run

The review covers the commits of your branch that are not on the default branch of origin. --base <branch or commit> picks another base. --mr <n> reviews GitHub pull request n or GitLab merge request n of the project the origin remote names, with its title and description, read through the GitHub CLI (gh) or the GitLab CLI (glab).

provider What it needs
anthropic ANTHROPIC_API_KEY
openai OPENAI_API_KEY
openrouter OPENROUTER_API_KEY
chatgpt A sign-in with kerpeten auth login; the requests count against your ChatGPT plan

A model of anthropic, openai or openrouter can also send its requests to another endpoint that speaks the same API, with base_url and api_key_env; Configuration tells how. A chatgpt model has no such settings.

  1. Change. Kerpeten takes the diff between the base and HEAD.
  2. Reviewer. The reviewer model reads the diff and the rule files, looks into the repository with its read-only tools and reports findings. Each one names a file, lines, a category, the evidence and a fix.
  3. Filter. Findings that point to a file or to lines that do not exist are dropped.
  4. Judge. Each finding goes to the judge model in its own call. The judge checks it against the code and labels it: verified, unverified or refuted, with a priority, a nature and the effort of the fix.
  5. Scorer. The labels become a score from 0 to 100. The score decides what a posted review would do with the finding: a comment on its line, a line in the summary, or nothing.
  6. Comment plan. For a pull request or merge request, Kerpeten decides what it would write: which findings become comments on lines of the diff, which go to the one summary comment and which are already written; nothing is posted yet.
Command What it does
kerpeten init Asks for the models and the comment language, writes .kerpeten.yml and checks the setup
kerpeten review --dry-run [--base <rev>] [--mr <n>] [--context-file <path>] [--extra-context <path or ->] [--json] Reviews the change and prints the findings
kerpeten auth login | logout | status [--models] Signs in with ChatGPT for models with provider: chatgpt
kerpeten self-check Checks the build without the network
kerpeten capabilities Lists what the build can reach (git, the file system, other processes) with the permission each one needs, the permission groups, and the harnesses with the permissions they list

The npm package brings a ready binary for Linux (x64 and arm64, glibc) and for macOS (arm64). npm picks the one for your machine; Node.js 18 or later is needed only for the small launcher that starts it. There is no build yet for Windows, for Intel Macs or for a musl Linux such as Alpine: on those the kerpeten command stops with an error that says so.