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
-
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}
.
- Name of the repository in format
Examples
-
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.
- Name of the repository in format
Examples
-
Locate Relevant Issues
npi app github "Find the issues in the repo npi-ai/npi related to feature request."
-
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."
-
Modify an Issue Content
npi app github "Find the issue titled 'Test' in npi-ai/npi and change the description to 'Hello World'."
-
Comment on an Issue
npi app github "Find the issue titled 'Test' in npi-ai/npi and add a comment 'Hello World'."
-
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.
- Name of the repository in format
Examples
-
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."
-
Edit an Existing Pull Request
npi app github "Edit the PR titled 'Update' in npi-ai/npi and revise the description to 'Updated Readme'."
-
Comment on a Pull Request
npi app github "Comment 'Looks good to me' on the PR titled 'Feature Addition' in npi-ai/npi."
-
Close Pull Requests
npi app github "Close all pull requests in npi-ai/npi."
Footnotes
Footnotes
-
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. ↩