Introduction
@github-tools/sdk wraps the GitHub REST API into AI-callable tool definitions that plug directly into the AI SDK.
Pass them to generateText, streamText, or any agent loop — the model decides which GitHub operations to call.
Explore the tools
The SDK ships 42 tools covering repositories, branches, pull requests, issues, commits, code search, gists, and workflows. Each tool wraps a GitHub API operation (mostly REST; line-level blame uses the GraphQL Commit.blame field) and is fully typed with Zod schemas.
Browse the full list in the Tools Catalog.
Compose tools with presets
Instead of wiring tools individually, use a preset to get a curated subset for a specific workflow:
| Preset | Tools included | Use case |
|---|---|---|
repo-explorer | repository metadata, branches, file content, code search, gists, workflows | knowledge retrieval, repo Q&A |
code-review | pull requests, commits, file diffs, review comments | PR copilots, change summaries |
issue-triage | issues, labels, comments, close/create | support triage, backlog bots |
ci-ops | workflows, runs, jobs, commits, repository context | CI monitoring, build ops |
maintainer | all tool families | full operator workflows |
Learn more in Scope with Presets.
Use pre-built agents
For the highest level of abstraction, createGithubAgent returns a ready-to-use agent with tools, presets, and system instructions wired together:
import { createGithubAgent } from '@github-tools/sdk'
const reviewer = createGithubAgent({
model: 'anthropic/claude-sonnet-4.6',
preset: 'code-review',
system: 'You review PRs for security issues. Cite file paths and line numbers.',
})
See Examples for more agent patterns.
Durable agents (long-running / crash-safe)
For chat apps and agents that must survive restarts and retries, use durable execution via the Vercel Workflow SDK. Import createDurableGithubAgent from @github-tools/sdk/workflow inside a function marked with "use workflow". Each GitHub tool already runs as a durable "use step", and the durable agent makes the LLM loop itself step-aware.
Read the full walkthrough in Durable workflows (Vercel Workflow), or see the examples/pr-review-agent/ starter for a complete PR review agent connected to GitHub via Chat SDK.
Agent Skills
Install the github-tools-agents skill with npx skills add https://github-tools.com, or use the copy-paste prompts embedded on Installation, Quick Start, and the other guide pages. Details: Agent Skills.