@openpets/github
v1.0.3
Published
Full-featured GitHub plugin for OpenCode - manage repositories, issues, pull requests, releases, workflows, and more
Downloads
13
Maintainers
Readme
GitHub Plugin
Complete GitHub API integration for OpenCode. Manage repositories, issues, pull requests, releases, workflows, and more.
Setup
1. Create a GitHub Personal Access Token
- Go to Create New Token to create a fine-grained token automatically
- Or use Classic Tokens and click "Generate new token (classic)"
- Select scopes:
repo- Full control of private repositoriesworkflow- Update GitHub Action workflowsgist- Create and manage gistsnotifications- Access notifications
- Copy the generated token
2. Configure Environment
Add to your .env file:
GITHUB_TOKEN=ghp_your_token_here3. Test Connection
cd pets/github
opencode run "test github connection"Available Tools
Repository Management
github-list-repos- List repositories for user/orggithub-get-repo- Get detailed repo informationgithub-search-repos- Search GitHub repositoriesgithub-star-repo- Star/unstar a repositorygithub-fork-repo- Fork a repository
Issues
github-list-issues- List issues with filtersgithub-get-issue- Get issue detailsgithub-create-issue- Create new issuegithub-update-issue- Update issue (title, body, state, labels)github-add-issue-comment- Add comment to issuegithub-list-issue-comments- List comments on issuegithub-search-issues- Search issues and PRs
Pull Requests
github-list-pull-requests- List PRs with filtersgithub-get-pull-request- Get PR details (commits, files, reviews)github-create-pull-request- Create new PRgithub-merge-pull-request- Merge a PR
Branches & Commits
github-list-branches- List repository branchesgithub-list-commits- List commits with filtersgithub-get-commit- Get commit details
File Contents
github-get-file-content- Read file from repositorygithub-search-code- Search code on GitHub
Releases
github-list-releases- List repository releasesgithub-create-release- Create new release
GitHub Actions
github-list-workflow-runs- List workflow runs with filters
Gists
github-list-gists- List user gistsgithub-create-gist- Create new gist
Users & Notifications
github-test-connection- Test connection and get authenticated usergithub-get-user- Get user profile informationgithub-list-notifications- List notifications
Example Queries
# List your repositories
opencode run "list my repositories"
# Search for popular TypeScript repos
opencode run "search for typescript repositories with stars:>10000"
# List open issues in a repo
opencode run "list open issues in facebook/react"
# Get pull request details
opencode run "get pull request #123 from owner/repo"
# View recent workflow runs
opencode run "show workflow runs for owner/repo"
# Read a file from a repo
opencode run "get contents of README.md from owner/repo"
# Create an issue
opencode run "create issue titled 'Bug report' in owner/repo"Search Qualifiers
Use GitHub's search syntax for powerful queries:
Repository Search
language:typescript- Filter by languagestars:>1000- Minimum starsforks:>100- Minimum forkstopic:react- By topicuser:octocat- By user
Issue/PR Search
is:issueoris:pr- Type filteris:openoris:closed- State filterlabel:bug- By labelauthor:username- By authorrepo:owner/name- In specific repo
Code Search
extension:ts- By file extensionpath:src/- In specific pathrepo:owner/name- In specific repo
Token Scopes Reference
| Scope | Required For |
|-------|--------------|
| repo | All repository operations |
| workflow | GitHub Actions |
| gist | Gist operations |
| notifications | Notifications |
| read:user | User profile info |
