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.

Download files

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

Source Distribution

chp_adapter_github-0.12.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

chp_adapter_github-0.12.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file chp_adapter_github-0.12.0.tar.gz.

File metadata

  • Download URL: chp_adapter_github-0.12.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for chp_adapter_github-0.12.0.tar.gz
Algorithm Hash digest
SHA256 64c213abf904c11fb266ec4bf1befb368dc495e8b3e0770ca8e7fe979fe110f6
MD5 b693e6ba0b5b2c0a44752069ad57339c
BLAKE2b-256 dfc810e3b9f2db74ea03595997f8625d3c9db2ef25b5c67a3fff072cd62a25de

See more details on using hashes here.

File details

Details for the file chp_adapter_github-0.12.0-py3-none-any.whl.

File metadata

File hashes

Hashes for chp_adapter_github-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aeca9c31b133feaa006f1070df6b9794758cb6e2b2f4ab6dda00bf7b4179f738
MD5 8f16b2d2f0b019c86a017101471db679
BLAKE2b-256 bcc028022851da29fb24cdc7447a9bbbe33617fb02e5c2caab967707f9f24ae9

See more details on using hashes here.

Release history Release notifications | RSS feed

0.28.0

2 files

0.27.0

2 files

0.26.0

2 files

0.25.0

2 files

0.24.0

2 files

0.23.0

1 file

0.22.0

2 files

0.21.0

2 files

0.20.0

2 files

0.19.0

2 files

0.18.0

2 files

0.17.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.0

2 files

0.13.1

2 files

0.13.0

2 files

This release

0.12.0 This release

2 files

0.11.0

2 files

0.10.0

1 file

0.8.0

1 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