Skip to main content

kaniscope

AI pull-request reviewer: fetches a PR's diff, reviews it, and posts line-anchored inline comments plus a summary. Works with GitHub, GitLab and Bitbucket.

The wheel carries a native binary, not an extension module — so it is independent of your Python version, needs no compiler, and adds no runtime dependencies. Same arrangement uv and ruff use.

pip install kaniscope          # or: uv tool install kaniscope
kaniscope --provider github --repo me/app --pr 12 --dry-run

As a library

Build a bot in Python and drive the engine from it:

from kaniscope import review

out = review(
    provider="github",
    repo="me/app",
    pr=12,
    dry_run=True,
    env={"OPENROUTER_API_KEY": key, "GH_TOKEN": token, "MODEL": "anthropic/claude-sonnet-5"},
)

print(out["recommendation"], out["findings"], "finding(s)")
for f in out.get("findingsDetail", []):
    print(f"{f['severity']} {f['file']}:{f.get('line', '-')}{f['body']}")

A review takes minutes, so inside a webhook handler use the async form, which also streams the engine's progress:

from kaniscope import review_async

out = await review_async(
    provider="github", repo="me/app", pr=12,
    on_log=lambda line: log.info(line),
)

Both raise KaniscopeError when the engine exits non-zero, carrying exit_code and the full stderr.

Configuration

Everything beyond these arguments — the model, the API key, provider tokens, file globs, confidence floors, bot identity — is read from the environment, exactly as it is for the Rust library. Pass overrides in env (merged over os.environ, unless inherit_env=False).

The essentials: OPENROUTER_API_KEY, plus GH_TOKEN / GITLAB_TOKEN / Bitbucket credentials for the provider you use. See the engine README for the full list, and .prbot.toml for per-repo settings.

API

Function What it does
review(**kwargs) Review a PR, or a local diff with local=True.
review_async(**kwargs) The same, without blocking the event loop.
schema() The JSON Schema of a review result. No key, no network.
version() The engine version this wheel's binary was built from.
binary_path() Absolute path to the installed binary.

RunReviewOutput, Finding, InlineComment and Usage are TypedDicts generated from the binary's own --schema, so they cannot drift from what the engine actually emits.

Reviewing without a PR

kaniscope --local --base main            # the working tree against a ref
git diff --staged | kaniscope --local    # any diff, from anywhere

Through the API, base picks the ref and diff is the stdin form:

review(local=True, base="main")
review(local=True, diff=pathlib.Path("change.patch").read_text())

Same reviewer, same prompts, same anchoring — it just has nowhere to post.

Why a binary and not a pyo3 extension

The engine takes five scalars, reads its configuration from the environment, and returns one JSON document after minutes of network and git work. Binding that through an extension module would buy nothing a pipe does not already give, and would cost a wheel per interpreter ABI plus a second declaration of every wire type. This way there is one artifact per platform, valid for every Python that can install it.

License

MIT OR Apache-2.0. Source: nhatvu148/pr-review-core.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

kaniscope-0.26.1-py3-none-win_amd64.whl (4.4 MB view details)

Uploaded Python 3Windows x86-64

kaniscope-0.26.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

kaniscope-0.26.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

kaniscope-0.26.1-py3-none-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

kaniscope-0.26.1-py3-none-macosx_10_12_x86_64.whl (4.4 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file kaniscope-0.26.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: kaniscope-0.26.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 4.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for kaniscope-0.26.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 7cf3a4fe21ff86652defed81f4c4102bcd076721ef572631f5d68886356d6a8a
MD5 f30273a135c831fac52fa1e3503104ec
BLAKE2b-256 41a2a5c3a83f7c07b8449e354b1b74b24ba53d7e00315decbbbf165e6d36a4a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaniscope-0.26.1-py3-none-win_amd64.whl:

Publisher: dist.yml on nhatvu148/pr-review-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kaniscope-0.26.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kaniscope-0.26.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 719fdf0a987c4af3dbf748363047598941a8d034cdf59078f3b0e6b07d12ae3f
MD5 94301ec1f0f59d858235310aafb2a2f2
BLAKE2b-256 fabde3def4faece39b2cb11e00e1a1253e59bb9fd01a99273a196a6610588db9

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaniscope-0.26.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: dist.yml on nhatvu148/pr-review-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kaniscope-0.26.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for kaniscope-0.26.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 aff76b5613209081916451ac477642a6c822d84e02b28764973cdf7abcaa0836
MD5 661cf66702c49ff9fa329083bb723937
BLAKE2b-256 f1a046cb24bfa3d6678f6a37fd41ea473c6aaf6ee5ba8e9f6330a74c5c3b4a95

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaniscope-0.26.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: dist.yml on nhatvu148/pr-review-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kaniscope-0.26.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for kaniscope-0.26.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1477982f2ca6f256b1b803814b62250fb3f32ac89bf3bc4e47cc58b3db04dcb7
MD5 2a481c68f65aacffe3e5c60660fa7365
BLAKE2b-256 c152245547141d220b5831a29998a3b7bf8d4dc896dedcf215e70b59c4302f1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaniscope-0.26.1-py3-none-macosx_11_0_arm64.whl:

Publisher: dist.yml on nhatvu148/pr-review-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kaniscope-0.26.1-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for kaniscope-0.26.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 652fb05b442e32ef99dba30172c5a2718c09a00251dbaf53f6e60904305e856b
MD5 fb78d04a32f682029bf9afcc42234ee1
BLAKE2b-256 8c663106a13918c9762e872b216aec5f1c5d727243578c444788a012ea2e4460

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaniscope-0.26.1-py3-none-macosx_10_12_x86_64.whl:

Publisher: dist.yml on nhatvu148/pr-review-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.27.0

5 files

This release

0.26.1 This release

5 files

0.26.0

5 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page