Skip to main content

GitHub

Interact with GitHub repositories, issues, pull requests, and file content via the GitHub REST API.

Quick Start

import { Agent, openai, GitHubToolkit } from "@radaros/core";

const gh = new GitHubToolkit();
// Uses GITHUB_TOKEN env var

const agent = new Agent({
  name: "github-assistant",
  model: openai("gpt-4o"),
  instructions: "Help manage GitHub repositories and issues.",
  tools: [...gh.getTools()],
});

const result = await agent.run("List open issues in xhipment/radar-os");

Config

token
string
GitHub personal access token. Falls back to GITHUB_TOKEN env var.
apiBase
string
default:"https://api.github.com"
GitHub API base URL. Override for GitHub Enterprise.

Tools

ToolDescription
github_search_reposSearch repositories by query. Returns names, stars, descriptions.
github_list_issuesList issues for a repository (excludes PRs).
github_get_issueGet full details of a specific issue.
github_create_issueCreate a new issue with title, body, and labels.
github_list_prsList pull requests for a repository.
github_get_file_contentGet file content from a repo (auto-decodes base64).

Environment Variables

export GITHUB_TOKEN="ghp_..."
Create a token at github.com/settings/tokens. Required scopes depend on your use case — repo for private repos, public_repo for public only.