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, provider tokens, file globs, confidence floors, bot identity — is engine configuration. Pass it typed:

out = review(
    provider="github", repo=repo, pr=pr,
    config={"openrouter_model": "anthropic/claude-sonnet-5", "min_confidence": 70, "agentic": True},
)

ReviewConfig is a TypedDict generated from the engine's own spec — every option with its type, default and documentation — so it cannot drift from what the binary actually reads.

env still takes raw strings and is applied after config, so it wins. That is deliberate: it stays the escape hatch for anything the typed layer does not model.

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

Uploaded Python 3Windows x86-64

kaniscope-0.27.0-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.27.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

kaniscope-0.27.0-py3-none-macosx_11_0_arm64.whl (4.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

kaniscope-0.27.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.27.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: kaniscope-0.27.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 4.5 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.27.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 dadd765771d088491078a2b74a99c94a73165cea68af431f5406b35cf9ade577
MD5 2febfbb4ee01f7cf0d2d2345ee9d561e
BLAKE2b-256 7fd2c69332dca42dc906d9fe3380eed052c4b8ee83220ee2aa9d4b47de745d2c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kaniscope-0.27.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5976936f7a98cc895fc959ea30fd1db3c89e6e2028031b9a5b660add6b198a2
MD5 c6af4842f416d6f5163e91002ea07e3a
BLAKE2b-256 6a1b0b04966ad56256687c571bd97f72986276d2fe36ba95e5d6372fd0ed55c8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kaniscope-0.27.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b3952d7b9fe81a39c5b11fc7642377f397f82e817677d5cfc77bc1861cc07559
MD5 a886bffed5dc68943f51dfb38ec277cd
BLAKE2b-256 13f860ecd5057bab1092036c001fb8e9af0bcb5be59a0a9343333b089d1e4511

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kaniscope-0.27.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 59d9d001a8ca206c2f31e0fa9122a738250bec07df50651fcbd99ec3f40b9bf5
MD5 22371eaff1f956dc5fdae5d3a3d9434b
BLAKE2b-256 7126bafe09401e4f5408be8b4ca793c77be90ae3cfcd184a4ec1386d7535b3c6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for kaniscope-0.27.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 eec67a06cd709b8d4f1176476bff80847e9ee80570d8686a1016f9bc01c27d2c
MD5 5a6d68543c06a7a67e698c2d4450edbb
BLAKE2b-256 2def2736f84cb2ab2d22464edf423c0817d23b22ec2c07425b11558a8449862e

See more details on using hashes here.

Provenance

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

This release

0.27.0 This release

5 files

0.26.1

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