#39
feat: add commit comment tools
Adds five commit-comment tools, bringing the total to 47. They follow the existing core → tools → registry pattern and are wired through the AI SDK entry, presets, the @github-tools/sdk/eve subpath, the chat app, and docs.
| Tool | Type | GitHub endpoint |
|---|---|---|
getCommitComment | read | repos.getCommitComment |
listCommitComments | read | repos.listCommentsForCommit (comments on one commit) |
createCommitComment | write (approval) | repos.createCommitComment |
updateCommitComment | write (approval) | repos.updateCommitComment |
deleteCommitComment | write (approval) | repos.deleteCommitComment |
createCommitComment can be general or anchored to a diff line via path + position. The three write tools require approval by default.
Presets: reads are in code-review, repo-explorer, and maintainer; createCommitComment is also in code-review; update/delete are maintainer-only — mirroring how PR and gist comment tools are distributed.
Example
import { createGithubTools } from '@github-tools/sdk'
import { generateText } from 'ai'
const result = await generateText({
model: yourModel,
tools: createGithubTools({ token: process.env.GITHUB_TOKEN! }),
prompt: 'Leave a comment on commit abc123 in vercel/ai noting the missing null check, then list all comments on it.',
})Or cherry-pick a single factory:
import { createCommitComment } from '@github-tools/sdk'
const tools = {
createCommitComment: createCommitComment(process.env.GITHUB_TOKEN!),
}Activity
4Thank you for following the naming conventions! 🙏
Thanks @bensabic! Closing this for now while we rework the tool set. We may reopen it later.
The latest updates on your projects. Learn more about Vercel for GitHub.