Skip to main content

chp-adapter-github

GitHub inspection as governed Capability Host Protocol capabilities. Read-only first slice: repositories, pull requests, issues, CI workflow runs, and PR reviews — each exposed as chp.adapters.github.<op> with a full execution evidence chain.

Built on the canonical chp-core adapter template (BaseAdapter + @capability), the same pattern as chp-adapter-mcp.

Install

pip install chp-adapter-github

Usage

from chp_core import LocalCapabilityHost, register_adapter
from chp_adapter_github import GitHubAdapter, GitHubConfig

host = LocalCapabilityHost()
register_adapter(host, GitHubAdapter(GitHubConfig()))  # token from GITHUB_TOKEN

pr = host.invoke("chp.adapters.github.get_pull_request", {
    "owner": "capabilityhostprotocol", "repo": "chp-core", "number": 1,
})
print(pr.data["state"], pr.data["mergeable_state"])

Capabilities (read-only)

Capability Purpose
chp.adapters.github.get_repo Repository metadata
chp.adapters.github.list_pull_requests List PRs (state filter)
chp.adapters.github.get_pull_request Single PR + merge/CI detail
chp.adapters.github.list_issues List issues (PRs excluded)
chp.adapters.github.get_issue Single issue
chp.adapters.github.list_workflow_runs GitHub Actions CI status
chp.adapters.github.list_pr_reviews Reviews on a PR

Each returns a curated projection — a capability, not a raw API mirror.

Auth

GitHubConfig.token (or the GITHUB_TOKEN / GH_TOKEN env var). A token is optional for public reads but raises the rate limit. The token is sent in the Authorization header and never appears in evidence payloads.

Design notes

  • A fresh httpx.AsyncClient is created per call: the host runs handlers via asyncio.run (a new loop per host.invoke), and an AsyncClient is loop-bound.
  • GitHubConfig.transport accepts an httpx transport (e.g. httpx.MockTransport) for tests — no network required.
  • Write operations (create issue, comment, etc.) are a deliberate later slice; they carry a higher risk tier and policy gates.

Metadata

Release files for chp-adapter-github 0.53.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chp-adapter-github 0.53.0
File Size Uploaded
chp_adapter_github-0.53.0.tar.gz 16.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chp-adapter-github 0.53.0
File Interpreter ABI Platform
chp_adapter_github-0.53.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.5 kB

Release files / chp_adapter_github-0.53.0.tar.gz

Download URL chp_adapter_github-0.53.0.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1a2bba44f2f6df284ed1d471b11b9f3151c4b4975258ff929ecc6c6420c982dd
BLAKE2b-256 checksum
How to use checksums
4688ce5e004eadea3c9b240939d6721b86598b33b7224f11fe18cc31d370356e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release files / chp_adapter_github-0.53.0-py3-none-any.whl

Download URL chp_adapter_github-0.53.0-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
443cd78ed814b0673ba12f402b7554ef3d6af8e910cf9d051955ea04af49b080
BLAKE2b-256 checksum
How to use checksums
34ef963a0174a7a1cf209aae30dcfbb02e26e25f8a647052f4834948bd1134a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.53.0 This release

2 release files

0.28.0

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.23.0

1 release file

0.22.0

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

1 release file

0.8.0

1 release file

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