New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@tooly/github

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tooly/github

GitHub API tools for OpenAI, Anthropic, and AI SDK

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

@tooly/github

GitHub API tools for OpenAI, Anthropic, and AI SDK.

Installation

npm install @tooly/github

Usage

With AI SDK

import { createAITools } from '@tooly/github'

const tools = createAITools('your-github-token')

// Use with AI SDK
import { generateText } from 'ai'

const result = await generateText({
  model: openai('gpt-4.1-nano'),
  tools,
  prompt: 'Create a new issue in my repo called "Fix bug in login"',
})

With OpenAI

import { createOpenAIFunctions } from '@tooly/github'

const { functions, callFunction } = createOpenAIFunctions('your-github-token')

// Use with OpenAI client
const response = await openai.chat.completions.create({
  model: 'gpt-4',
  messages: [{ role: 'user', content: 'Create an issue in my repository' }],
  functions,
})

// Handle function calls
if (response.choices[0].message.function_call) {
  const result = await callFunction(response.choices[0].message.function_call)
}

Direct Usage

import { GitHubTools } from '@tooly/github'

const github = new GitHubTools('your-github-token')

// Create an issue
const issue = await github.getHandlers().createIssue({
  owner: 'username',
  repo: 'repository',
  title: 'Bug report',
  body: 'Description of the bug',
  labels: ['bug', 'high-priority'],
})

console.log(`Created issue #${issue.number}`)

Available Tools

Issues

  • createIssue - Create a new issue in a repository
  • getIssue - Get details of a specific issue
  • updateIssue - Update an existing issue
  • searchIssues - Search for issues using various filters

Repositories

  • getRepository - Get details of a repository

Users

  • getUser - Get user details (authenticated user or by username)

Authentication

You need a GitHub personal access token to use this package. You can create one at: https://github.com/settings/tokens

The token needs the following scopes:

  • repo - Full control of private repositories
  • public_repo - Access public repositories
  • user - Read user profile data

License

MIT

Keywords

github

FAQs

Package last updated on 30 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts