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.0-py3-none-win_amd64.whl (4.4 MB view details)

Uploaded Python 3Windows x86-64

kaniscope-0.26.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

kaniscope-0.26.0-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.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: kaniscope-0.26.0-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.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 3a8c6a10b54d39042578f8a2e16b306a645bb1aa67d67bc9dd16aec22a81132f
MD5 eda0d431565650d943e1203da8c36bdd
BLAKE2b-256 639235b14c4125001f02fdc4c7f464c2b8c0eac1df822ec5429d61c8c35ba554

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaniscope-0.26.0-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.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kaniscope-0.26.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e2affc92406414249877894099a72ec680edc2bd47f4b27aa9e1ce988a7ad98e
MD5 371de301e03ec0bba40db2757185debc
BLAKE2b-256 654d7e9a250e237ca0426a67783eb80c588a544d1bee3c27ee787366b42c51dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaniscope-0.26.0-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.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for kaniscope-0.26.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9dc32c293ef465203e1b3c99b0b9f4a04bc5d3f2a045a0ddef3365f79da81ee3
MD5 79328fd29a937e4b571c3528fe91a48a
BLAKE2b-256 05a065278076c0045878c72ea54c03423b73e88c3a84dc887464b2fff25fbc8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaniscope-0.26.0-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.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for kaniscope-0.26.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c1e5fba7fabb1975b338a59a701fda81a022d3a1c6b367efb35caa10b9b7de05
MD5 ab0cca1eef00fd71eb2526e73a94f38c
BLAKE2b-256 515d26a457bb2b1e720f3838cbdb82565d4303213a355c1214571442efbbfc2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaniscope-0.26.0-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.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for kaniscope-0.26.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 cf10a4c8483fad39dca74be7118e2fddf0e8e855722b49e26297e743f554f9b8
MD5 139972e974b65659b31136851962c1b4
BLAKE2b-256 fcc8dfe74797f522a0ceb6027ae6f4e0ad8a04013482b1c7db07ded1936f320f

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaniscope-0.26.0-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

0.26.1

5 files

This release

0.26.0 This release

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