Docs
Official Tools
Function Tools
GitHub

GitHub

The GitHub Tool is crafted to refine your GitHub workflow, offering efficient management of issues and pull requests. It also enriches community engagement, allowing you to easily star or fork favored repositories.

Setup

Get Github Access Token

Follow this guide to get your GitHub access token: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens (opens in a new tab). You may need to grant the repo scope so that NPi can access repositories on behalf of you. (Read more about scopes (opens in a new tab))

Authorization

npi auth github --access-token <github-access-token>

Usage

npi app github "Star and fork the repo npi-ai/npi."

Supported Features

Repository Search

  • Description: Find repositories on GitHub.
  • In-Context Parameters1:
    • Keywords or a short description of the desired repositories.
    • (Optional) Maximum number of results to return.

Examples

  1. Discover Top Python Repositories

    npi app github "Search for the top 10 python repos with over 1000 stars."

Repository Engagement

  • Description: Actively engage with repositories by starring or forking.
  • In-Context Parameters:
    • Name of the repository in format {owner}/{repo}.

Examples

  1. Star and Fork an Repository

    npi app github "Star and fork the repo npi-ai/npi."

Issue Management

  • Description: Efficiently manage GitHub issues, from fetching to creating, editing, commenting on, and closing issues.
  • In-Context Parameters:
    • Name of the repository in format {owner}/{repo}.
    • Keywords or a short description of the desired issues.

Examples

  1. Locate Relevant Issues

    npi app github "Find the issues in the repo npi-ai/npi related to feature request."
  2. Create an Issue with a Label

    npi app github "Create a test issue in npi-ai/npi with label 'Test' and assign it to @idiotWu."
  3. Modify an Issue Content

    npi app github "Find the issue titled 'Test' in npi-ai/npi and change the description to 'Hello World'."
  4. Comment on an Issue

    npi app github "Find the issue titled 'Test' in npi-ai/npi and add a comment 'Hello World'."
  5. Close Issues

    npi app github "Close all issues in npi-ai/npi."

Pull Request Management

  • Description: Handle pull requests with options to fetch, create, close, update, or comment on them.
  • In-Context Parameters:
    • Name of the repository in format {owner}/{repo}.
    • Keywords or a short description of the desired pull requests.

Examples

  1. Create a Pull Request

    npi app github "Open a pull request in npi-ai/npi from 'npi-test' branch to 'main' branch with the title 'New Feature' and a detailed body."
  2. Edit an Existing Pull Request

    npi app github "Edit the PR titled 'Update' in npi-ai/npi and revise the description to 'Updated Readme'."
  3. Comment on a Pull Request

    npi app github "Comment 'Looks good to me' on the PR titled 'Feature Addition' in npi-ai/npi."
  4. Close Pull Requests

    npi app github "Close all pull requests in npi-ai/npi."
Didn't find the feature you were looking for? Feel free to submit an issue or PR!

Footnotes

Footnotes

  1. In-Context Parameters refer to the special information that you may specify in the instructions. Parameters marked as Inferred could be deduced from the context without needing explicit mention.