# GitHubKit — GitHub toolbox in your IM
Query GitHub, search repositories, and push repository **events** (commits / PRs / issues / releases / stars / forks) into any chat. Powered by background polling of the GitHub Events API, so it needs **no public webhook ingress** and works in any deployment.
[简体中文](readme/README_zh_Hans.md)
## Commands
### Query / integration
| Command | Description |
|---|---|
| `!gh repo <owner/repo>` | Repo info (stars/forks/language/license…) |
| `!gh issues <owner/repo> [open\|closed\|all]` | Issue list |
| `!gh prs <owner/repo> [open\|closed\|all]` | PR list |
| `!gh issue <owner/repo> <number>` | Issue/PR detail |
| `!gh releases <owner/repo>` | Release list |
| `!gh user <username>` | User info |
| `!gh search <keyword>` | Search repos (by stars) |
You can also paste a repo URL directly (`https://github.com/owner/repo`).
### Event push (subscriptions)
| Command | Description |
|---|---|
| `!gh sub <owner/repo> [events...]` | Subscribe push to this chat |
| `!gh unsub <owner/repo>` | Unsubscribe |
| `!gh subs` | List this chat's subscriptions |
Event types (multi-select, default all): `push`(commits) / `pr` / `issue` / `release` / `star` / `fork`.
Example:
```
!gh sub langbot-app/LangBot push pr release
```
Only posts when that repo has new commits, PR changes, or a new release.
## How it works
- On `initialize()` the plugin starts a background `asyncio` poller that fetches `GET /repos/{owner}/{repo}/events` for every subscribed repo at the configured interval.
- Deduplicates with `last_event_id`, pushing only events newer than the last seen; on first subscription it records the current cursor and never backfills history.
- Subscriptions (including `bot_uuid` + chat target) are persisted in the plugin KV store, so push continues after a restart.
## Configuration
- `language` (default `zh_Hans`): language for all bot messages and event-push notifications — `en_US` or `zh_Hans`.
- `github_token`: GitHub personal access token. **Strongly recommended** — raises the rate limit from 60/hr to 5000/hr (required for event polling) and enables private repos.
- `poll_interval` (default 120, min 60): poll interval in seconds. GitHub caches the events feed ~60s, so lower values don't help.
- `max_events_per_push` (default 5): max events per repo per push, to avoid flooding after downtime.
## Rate limit note
Without a token the anonymous quota is only 60 requests/hour, which a few subscribed repos will exhaust quickly. Always configure a token for production use.
GitHubKit by RockChinQ
GitHub integration for your IM: query repos / issues / PRs / releases / users, search, and subscribe chats to repository event push (commits, PRs, issues, releases, stars) via background polling.
Loading...