Skip to content
← Public packages

@kentcdodds/github

GitHub REST, GraphQL, and pull request helpers for Kody agents.

README.md

43 lines · 1.9 KB · Markdown

@kentcdodds/github

Intent

One GitHub helpers package for Kody agents, with two BYO OAuth identities: kody-bot (account: 'bot', integration github-bot) is the default for every call; Kent C. Dodds (account: 'kent', integration github-kent) is used only when the user explicitly asks to act as Kent. Agents must not infer Kent from private repos, org access, or “the bot might not have permission.”

What it does

  • Authenticated GitHub REST and GraphQL calls (request, graphql, paginate)
  • Identity check for the selected account (get-viewer)
  • Pull request helpers: info, CI checks, merge (bounded + durable escalation), draft/ready toggle
  • Create or update GitHub Actions secrets without returning plaintext (actions/put-secret)

Prerequisites / setup

Two user-owned GitHub OAuth connections to the same BYO GitHub OAuth app (not the Kody platform app), both with god-level scopes (gist, notifications, read:org, read:user, repo, user:email, workflow):

  1. Connect github-bot while signed into GitHub as kody-bot (default).
  2. Connect github-kent while signed into GitHub as kentcdodds (explicit Kent-only).
  3. Reconnect if needed: /connect/oauth?provider=github-bot or /connect/oauth?provider=github-kent.
  4. Agents: see AGENTS.md for import paths and smoke checks.

OAuth access/refresh tokens live on the saved integrations (github-bot, github-kent). Helpers authenticate with createAuthenticatedFetch — never paste token values in chat, and do not require mirrored user secrets named github-botAccessToken / github-kentAccessToken.

Done when

  • Both OAuth connections work; get-viewer for bot returns kody-bot
  • kent is used only after an explicit user request
  • REST/GraphQL and PR helpers succeed with the intended account
  • Actions secrets can be put without plaintext ever leaving the helper