GitHub Integration
Create GitHub tools — manage issues, pull requests, and repositories.
Setup
import { createGitHubTools } from '@ahzan-agentforge/core';
const tools = createGitHubTools({
token: process.env.GITHUB_TOKEN!,
owner: 'my-org',
repo: 'my-repo',
});GitHubToolConfig
interface GitHubToolConfig {
token: string; // GitHub personal access token
owner: string; // Repository owner
repo: string; // Repository name
}Available Tools
createGitHubTools() returns tools for:
- create-issue — create a new issue
- list-issues — list repository issues
- create-pr — create a pull request
- list-prs — list pull requests
- get-file — read a file from the repository
Usage
const agent = defineAgent({
name: 'github-bot',
description: 'Manages GitHub issues and PRs',
tools: createGitHubTools({
token: process.env.GITHUB_TOKEN!,
owner: 'my-org',
repo: 'my-repo',
}),
llm,
systemPrompt: 'You manage GitHub issues and pull requests.',
});