@joe-broadhead/opencode-github 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/LICENSE +21 -0
- package/NOTICE +25 -0
- package/README.md +270 -2
- package/dist/index.js +8490 -0
- package/dist/tui.js +386 -0
- package/package.json +68 -4
- package/skills/github-code-research/SKILL.md +41 -0
- package/skills/github-issue-triage/SKILL.md +48 -0
- package/skills/github-pr-review/SKILL.md +45 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
4
|
+
|
|
5
|
+
## [0.0.1] - 2026-11-03
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- The tools RPC, `github.platform.tools`: a script can call GitHub's known MCP reads, and `api` (`github_api` limited
|
|
10
|
+
to REST GET and HEAD and single GraphQL queries), with no model, through `opencode api`, as a session and its agent.
|
|
11
|
+
It gets exactly the access that agent's model has: a tool its rules hide is refused, OpenCode checks each MCP call
|
|
12
|
+
against the agent's and the session's rules, and an ask is refused at once because no one is there to answer it.
|
|
13
|
+
`describe` lists the methods with each tool's live input schema. GitHub's writes, `ui_get` and any tool GitHub adds
|
|
14
|
+
later are never methods, and `api` refuses changes, downloads and uploads with `SCRIPT_READ_ONLY` before any
|
|
15
|
+
request. With `host` (GitHub Enterprise Server) only `api` runs. `docs/scripting.md` explains it.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- `check_dependency_vulnerabilities`, which GitHub's hosted server now lists in the `dependabot` toolset, is a known
|
|
20
|
+
read: it looks up a list of packages in the GitHub Advisory Database and changes nothing, so it runs without a
|
|
21
|
+
prompt, and `/github-status` no longer lists it as unknown.
|
|
22
|
+
|
|
23
|
+
## [0.0.0] - 2026-11-01
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- GitHub's hosted MCP server, registered under the name `github`. GitHub's `X-MCP-Toolsets`, `X-MCP-Readonly` and
|
|
28
|
+
`X-MCP-Lockdown` headers select the tools; read-only by default. The default toolsets are every read-only
|
|
29
|
+
toolset that the default `repo read:org` scopes cover, including Actions logs and security alerts; `ui_get`, the
|
|
30
|
+
MCP Apps data feed, is hidden.
|
|
31
|
+
- Sign-in on the `github` server's integration from `/connect`, `opencode auth login GitHub` and
|
|
32
|
+
`opencode mcp auth github`: a fine-grained personal access token (`github-token`), with the token page prefilled
|
|
33
|
+
for the default toolsets, and device sign-in (`github-device`) when `clientId` names an organisation's own OAuth
|
|
34
|
+
App. A token that GitHub later rejects marks the account as needing sign-in.
|
|
35
|
+
- `github_api`, a tool for GitHub's REST and GraphQL API with the same sign-in, for what the MCP tools cannot do:
|
|
36
|
+
auto-merge, releases and their assets, branch protection, rulesets, variables, artifacts and any GraphQL. Reads
|
|
37
|
+
run; changes ask through `github_api` rules on `METHOD /path` and are refused while read-only. Requests stay on
|
|
38
|
+
GitHub's API host, and redirects elsewhere are followed without the token.
|
|
39
|
+
- Option `host` for GitHub Enterprise Server: no MCP server there, `github_api` against the server's API, and sign-in
|
|
40
|
+
on a **GitHub Enterprise** integration (token, or device flow with the server's own `clientId`).
|
|
41
|
+
- Default permission rules in every agent with a base allow rule: known GitHub reads run, and writes and unknown
|
|
42
|
+
GitHub tools ask. User rules and saved approvals still win.
|
|
43
|
+
- Options `toolsets`, `readOnly`, `lockdown`, `unknownTools`, `clientId`, `scopes`, `allowUntestedHost` and `host`.
|
|
44
|
+
- One status, shown by `/github-status` and by the `/github` dialog in the TUI (palette **GitHub: Status**): state,
|
|
45
|
+
account and access, tools and unknown tool names, agents without the default rules with the rules to add, the
|
|
46
|
+
OpenCode check and the next step.
|
|
47
|
+
- A tested-host check: outside `>=2.2.3 <2.3.0` the plugin refuses to load with `HOST_UNTESTED`, unless
|
|
48
|
+
`allowUntestedHost` is set.
|
|
49
|
+
- Error messages that start with their code (`OPTIONS_INVALID`, `HOST_UNTESTED`) and end with a next step.
|
|
50
|
+
- Skills `github-pr-review`, `github-issue-triage` and `github-code-research`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Joe Broadhead
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
opencode-github bundles this third-party code into dist/.
|
|
2
|
+
|
|
3
|
+
## zod 4.6.7 (MIT)
|
|
4
|
+
|
|
5
|
+
MIT License
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2025 Colin McDonnell
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,271 @@
|
|
|
1
|
-
#
|
|
1
|
+
# GitHub for OpenCode
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Connects OpenCode to GitHub's hosted MCP server, so your agents can read and, if you allow it, change issues, pull
|
|
4
|
+
requests, code and more with GitHub's own tools.
|
|
5
|
+
|
|
6
|
+
Unofficial; not affiliated with GitHub. GitHub is a trademark of GitHub, Inc.
|
|
7
|
+
|
|
8
|
+
## Requirements
|
|
9
|
+
|
|
10
|
+
- OpenCode `>=2.2.3 <2.3.0`, tested on 2.2.3 and 2.2.4. On any other release the plugin refuses to load (see
|
|
11
|
+
[`allowUntestedHost`](https://github.com/joe-broadhead/opencode-github/blob/HEAD/docs/configuration.md#allowuntestedhost)).
|
|
12
|
+
- macOS or Linux.
|
|
13
|
+
- A GitHub account.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
opencode plugin add @joe-broadhead/opencode-github
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Restart OpenCode. `opencode mcp list` then shows `github needs authentication` until you sign in.
|
|
22
|
+
|
|
23
|
+
## Sign in
|
|
24
|
+
|
|
25
|
+
Run `/connect` and choose **GitHub**, then **Add account**. `/mcps` → `github` opens the same sign-in. From a
|
|
26
|
+
terminal, run `opencode auth login GitHub`.
|
|
27
|
+
|
|
28
|
+
Choose **Use a fine-grained personal access token**. OpenCode shows a link to GitHub's new-token page, already
|
|
29
|
+
filled in with the name "OpenCode GitHub" and the read access below. Choose the repositories, create the token and
|
|
30
|
+
paste it. The plugin checks the token with GitHub before it is saved. Classic tokens (`ghp_…`) work too.
|
|
31
|
+
|
|
32
|
+
**Fine-grained token permissions.** A fine-grained token reaches only what it is granted, and a tool without its
|
|
33
|
+
permission fails with "Resource not accessible by personal access token". The default toolsets read with these,
|
|
34
|
+
all read-only:
|
|
35
|
+
|
|
36
|
+
- Repository permissions (the token page fills these in): Metadata, Contents, Issues, Pull requests, Commit
|
|
37
|
+
statuses, Actions, Code quality, Code scanning alerts, Dependabot alerts, Secret scanning alerts, Repository
|
|
38
|
+
security advisories and Discussions.
|
|
39
|
+
- Organisation permissions, when the token's resource owner is an organisation: Members (teams), Issue Types and
|
|
40
|
+
Issue Fields.
|
|
41
|
+
|
|
42
|
+
Leave out any you don't need; only the tools that use them fail. Listing an organisation's repository security
|
|
43
|
+
advisories needs write access to Repository security advisories, so it fails with a read-only token.
|
|
44
|
+
|
|
45
|
+
Organisations can set `clientId` to their own OAuth App (Device Flow on, no client secret); `/connect` then also
|
|
46
|
+
offers **Sign in with GitHub**, a device sign-in with the scopes `repo` and `read:org`, which needs none of the token
|
|
47
|
+
permissions above.
|
|
48
|
+
|
|
49
|
+
**The browser.** In the TUI, press `o` or Enter to open the link in your browser (`c` copies a device code). The CLI,
|
|
50
|
+
`opencode auth login GitHub`, opens the browser automatically.
|
|
51
|
+
|
|
52
|
+
A fine-grained token reaches only the repositories you select, and GitHub enforces that. For writes
|
|
53
|
+
(`readOnly: false`), give the token write access to what those tools change, for example Issues or Pull requests.
|
|
54
|
+
|
|
55
|
+
To sign out, run `opencode auth logout GitHub`, or remove the account in `/connect` → **GitHub**.
|
|
56
|
+
|
|
57
|
+
## Use
|
|
58
|
+
|
|
59
|
+
Ask your agent about GitHub, for example "summarise the open pull requests in owner/repo" or "why did CI fail on
|
|
60
|
+
pull request 42?". Agents use GitHub's own tools, read-only by default, from these toolsets: repositories and code,
|
|
61
|
+
issues, pull requests, labels, Actions runs and job logs, Git trees, discussions, code scanning, secret scanning,
|
|
62
|
+
Dependabot and code quality alerts, security advisories, users and organisations. Examples: `github_issue_read`,
|
|
63
|
+
`github_pull_request_read`, `github_get_file_contents`, `github_search_code` and `github_get_job_logs`. In Code Mode
|
|
64
|
+
they are in the `github` namespace; `github_get_me`, `github_issue_read` and `github_pull_request_read` stay in the
|
|
65
|
+
direct tool list. Projects, gists and notifications need extra scopes, so they are off by default.
|
|
66
|
+
|
|
67
|
+
**`github_api`** covers what GitHub's MCP tools cannot do: auto-merge, creating releases and uploading their assets,
|
|
68
|
+
branch protection, rulesets, Actions variables, downloading artifacts and logs to a file, and any GraphQL. It calls
|
|
69
|
+
GitHub's REST or GraphQL API with your GitHub sign-in, for example
|
|
70
|
+
`{ "method": "GET", "path": "/repos/OWNER/REPO/branches/main/protection" }` or
|
|
71
|
+
`{ "graphql": { "query": "query { viewer { login } }" } }`. GET, HEAD and a single GraphQL query read; every other
|
|
72
|
+
call changes GitHub, asks first, and is refused while the plugin is read-only. Requests go only to GitHub's API; a
|
|
73
|
+
redirect to file storage is followed without your token. `download: { path }` saves a response to a file in the
|
|
74
|
+
project, and `upload: { path, contentType }` sends a project file as a release asset; both ask first.
|
|
75
|
+
|
|
76
|
+
Three skills come with it:
|
|
77
|
+
|
|
78
|
+
- `github-pr-review`: review a pull request from its description, changed files, diff, earlier reviews and checks.
|
|
79
|
+
- `github-issue-triage`: find and read issues, spot duplicates, and propose labels, priority and next steps.
|
|
80
|
+
- `github-code-research`: search repositories, read files at a branch or commit, and follow the history, citing
|
|
81
|
+
files and lines.
|
|
82
|
+
|
|
83
|
+
Each skill reports findings and changes nothing on GitHub unless you ask.
|
|
84
|
+
|
|
85
|
+
**Scripts.** A script or a cron job can call GitHub's read tools and `github_api`'s reads with no model, through
|
|
86
|
+
`opencode api`. It runs as a session and its agent, under that agent's permission rules and the session's own.
|
|
87
|
+
Scripts can never change anything on GitHub:
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
opencode api post /api/rpc/github.platform.tools/pull_request_read \
|
|
91
|
+
-d '{"input":{"sessionID":"ses_…","input":{"method":"get","owner":"OWNER","repo":"REPO","pullNumber":42}}}'
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
See [Scripting](https://github.com/joe-broadhead/opencode-github/blob/HEAD/docs/scripting.md).
|
|
95
|
+
|
|
96
|
+
**Status.** `/github` in the TUI, or **GitHub: Status** in the command palette, opens a dialog with the state, the
|
|
97
|
+
account and access, the tools (with the names of any the plugin does not know yet), the agents that miss the default
|
|
98
|
+
rules with the rules to paste, the OpenCode check and the next step. `r` refreshes it and `Esc` closes it. It also
|
|
99
|
+
refreshes when the sign-in, an account, the `github` server or the agents change. `/github-status` posts the same
|
|
100
|
+
status into the session as a note, without starting a model turn.
|
|
101
|
+
|
|
102
|
+
## Permissions
|
|
103
|
+
|
|
104
|
+
The plugin adds default rules to every agent that has OpenCode's base "allow everything" rule:
|
|
105
|
+
|
|
106
|
+
- Known GitHub read tools run without a prompt, also in `opencode run`.
|
|
107
|
+
- Writes (only present with `readOnly: false`) and GitHub tools the plugin does not know yet ask first. In
|
|
108
|
+
`opencode run`, nobody can answer, so they are denied.
|
|
109
|
+
|
|
110
|
+
Your own rules and saved approvals still win:
|
|
111
|
+
|
|
112
|
+
- A rule in the top-level `permissions` of your config overrides the defaults. For example, this lets
|
|
113
|
+
`github_create_pull_request` run without a prompt, and blocks merges:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"permissions": [
|
|
118
|
+
{ "action": "github_create_pull_request", "resource": "*", "effect": "allow" },
|
|
119
|
+
{ "action": "github_merge_pull_request", "resource": "*", "effect": "deny" }
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Every rule needs a `"resource"`. OpenCode skips a rule without it.
|
|
125
|
+
- `github_api` rules match `METHOD /path`, and `*` matches any text, slashes included. This lets the agent change one
|
|
126
|
+
owner's repositories without a prompt, and never delete anything:
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"permissions": [
|
|
131
|
+
{ "action": "github_api", "resource": "POST /repos/OWNER/*", "effect": "allow" },
|
|
132
|
+
{ "action": "github_api", "resource": "DELETE *", "effect": "deny" }
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
A GraphQL change is `POST /graphql`, and saving a download is `download <file>`. A deny on
|
|
138
|
+
`{ "action": "github_api", "resource": "*" }` removes the tool from the agent.
|
|
139
|
+
- Choosing **Always allow** at a prompt saves the approval for the whole project, for every agent, including Plan.
|
|
140
|
+
- Stricter agents stay strict: Plan keeps its own rules, and Explore still cannot run GitHub tools.
|
|
141
|
+
|
|
142
|
+
**Agents defined only in your config miss the defaults.** OpenCode creates them after plugins load, so they run
|
|
143
|
+
GitHub tools, including writes, without asking. `/github-status` and the `/github` dialog name these agents and show
|
|
144
|
+
the rules to copy. Put them **first** in **that agent's own** `permissions` list, in `opencode.json` or in the
|
|
145
|
+
agent's Markdown file, followed by your top-level rules for `github_` tools, so yours keep winning. Do not put these rules in the top-level `permissions`: that would weaken Explore
|
|
146
|
+
and any other agent that denies by default.
|
|
147
|
+
|
|
148
|
+
### If you have `gh` installed
|
|
149
|
+
|
|
150
|
+
The plugin does not use the GitHub CLI. If `gh` is installed and signed in on your machine, agents can still run it
|
|
151
|
+
through OpenCode's bash tool, with your own account, and OpenCode's bash tool runs commands without asking by
|
|
152
|
+
default. To keep `gh` behind a prompt, and its token out of reach, add bash rules:
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"permissions": [
|
|
157
|
+
{ "action": "bash", "resource": "gh *", "effect": "ask" },
|
|
158
|
+
{ "action": "bash", "resource": "gh pr view *", "effect": "allow" },
|
|
159
|
+
{ "action": "bash", "resource": "gh auth *", "effect": "deny" }
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Configure
|
|
165
|
+
|
|
166
|
+
Options go in the plugin's entry in `opencode.json`:
|
|
167
|
+
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"plugins": [{ "package": "@joe-broadhead/opencode-github", "options": { "toolsets": ["context", "repos", "issues"] } }]
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The options are `toolsets`, `readOnly`, `lockdown`, `unknownTools`, `clientId`, `scopes`, `allowUntestedHost` and
|
|
175
|
+
`host`.
|
|
176
|
+
|
|
177
|
+
**GitHub Enterprise Server.** Set `host` to the server's host name, such as `"host": "github.example.com"`. GitHub's
|
|
178
|
+
hosted MCP server does not support GitHub Enterprise Server, so the plugin then registers no MCP tools and
|
|
179
|
+
`github_api` is the tool. Sign in with `/connect` → **GitHub Enterprise**; device sign-in there needs `clientId` from an
|
|
180
|
+
OAuth App your administrator registers. For the MCP tools, run GitHub's `github-mcp-server` yourself. GHE.com (data
|
|
181
|
+
residency) is not supported yet.
|
|
182
|
+
[docs/configuration.md](https://github.com/joe-broadhead/opencode-github/blob/HEAD/docs/configuration.md) describes
|
|
183
|
+
each one, the toolsets, the default rules and permission recipes.
|
|
184
|
+
|
|
185
|
+
## Organisation rollout
|
|
186
|
+
|
|
187
|
+
An organisation can set the options for everyone on a machine in OpenCode's system config
|
|
188
|
+
(`/Library/Application Support/opencode/opencode.json` on macOS, `/etc/opencode/opencode.json` on Linux). It
|
|
189
|
+
overrides user and project config, so members only sign in:
|
|
190
|
+
|
|
191
|
+
```json
|
|
192
|
+
{
|
|
193
|
+
"plugins": [
|
|
194
|
+
{
|
|
195
|
+
"package": "@joe-broadhead/opencode-github",
|
|
196
|
+
"options": {
|
|
197
|
+
"clientId": "<your organisation's OAuth App client ID>",
|
|
198
|
+
"scopes": ["repo", "read:org"],
|
|
199
|
+
"toolsets": ["context", "repos", "issues", "pull_requests", "actions"],
|
|
200
|
+
"readOnly": true
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
`clientId` is needed only to use your organisation's own GitHub OAuth App (Device Flow on, no client secret).
|
|
208
|
+
|
|
209
|
+
- If the organisation restricts OAuth App access, its private repositories stay hidden from device sign-in until an
|
|
210
|
+
owner approves the app. Members can request approval on GitHub under **Settings → Applications → Authorized OAuth
|
|
211
|
+
Apps**.
|
|
212
|
+
- An organisation can require approval for fine-grained tokens, or block them. To reach its repositories, members
|
|
213
|
+
choose the organisation as the token's resource owner.
|
|
214
|
+
|
|
215
|
+
## Troubleshooting
|
|
216
|
+
|
|
217
|
+
`/github-status` and the `/github` dialog show the rows Connection, Account, Access, Toolsets, Host, Tools, Agents
|
|
218
|
+
without default rules, OpenCode and Next step. The Connection row and its next step:
|
|
219
|
+
|
|
220
|
+
| Connection | Next step |
|
|
221
|
+
| --- | --- |
|
|
222
|
+
| `connected` | Nothing to do. |
|
|
223
|
+
| `sign-in required` | Run /connect and choose GitHub (GitHub Enterprise with `host`). |
|
|
224
|
+
| `connecting` | GitHub is still starting. Check again in a few seconds. |
|
|
225
|
+
| `failed` | OpenCode could not reach GitHub's MCP server. Check your network connection, then reconnect github in /mcps. |
|
|
226
|
+
| `disabled` | Turn the github server back on in /mcps. |
|
|
227
|
+
| `not configured` | Restart OpenCode. If GitHub is still missing, check that no other plugin removes the MCP server named github. |
|
|
228
|
+
| `conflict` | Your OpenCode config or another plugin defines its own MCP server named github, so this plugin left it unchanged. Rename or remove that server to use this plugin's GitHub sign-in. |
|
|
229
|
+
|
|
230
|
+
Error codes:
|
|
231
|
+
|
|
232
|
+
| Code | What to do |
|
|
233
|
+
| --- | --- |
|
|
234
|
+
| `HOST_UNTESTED` | OpenCode is outside `>=2.2.3 <2.3.0`. Update OpenCode or the plugin, or set the option `allowUntestedHost: true` to load it anyway, with a warning in the status. |
|
|
235
|
+
| `OPTIONS_INVALID` | An option is unknown or has a wrong value; the message names it. Fix that option for the plugin in `opencode.json`. |
|
|
236
|
+
| `SIGN_IN_…`, `TOKEN_…`, `DEVICE_…`, `CLIENT_ID_UNKNOWN` | Sign-in failed. The message ends with the next step; [the error codes](https://github.com/joe-broadhead/opencode-github/blob/HEAD/docs/configuration.md#errors) list them all. |
|
|
237
|
+
|
|
238
|
+
A script's errors from the tools RPC have their own codes, listed in
|
|
239
|
+
[Scripting](https://github.com/joe-broadhead/opencode-github/blob/HEAD/docs/scripting.md#errors).
|
|
240
|
+
|
|
241
|
+
Other problems:
|
|
242
|
+
|
|
243
|
+
| You see | What to do |
|
|
244
|
+
| --- | --- |
|
|
245
|
+
| `/connect` shows **Sign in required** on your GitHub account ("GitHub rejected the saved sign-in. Sign in again.") | GitHub refused the saved token: it was revoked or expired. Choose the account to sign in again. |
|
|
246
|
+
| `UnexpectedStatus: 500` while signing in | OpenCode hides the reason when a pasted token fails its check, or when a device sign-in (with `clientId`) fails before the code is shown. OpenCode's log has it (`opencode debug paths` shows the log folder). Common reasons: the token has the wrong format or GitHub rejected it, or the OAuth App has Device Flow turned off. |
|
|
247
|
+
| GitHub tools cannot see an organisation's private repositories | See [Organisation rollout](#organisation-rollout). |
|
|
248
|
+
| `github_get_teams` returns `null` | The account is in no team, or the sign-in cannot read organisations. Sign in with `read:org`, or give the token organisation read access. |
|
|
249
|
+
| A rule in `permissions` has no effect | Add `"resource": "*"` to it. |
|
|
250
|
+
|
|
251
|
+
## Uninstall
|
|
252
|
+
|
|
253
|
+
1. Sign out: `opencode auth logout GitHub`.
|
|
254
|
+
2. Run `opencode plugin remove @joe-broadhead/opencode-github`, and remove any default rules you copied into agents.
|
|
255
|
+
3. On GitHub, delete the token under **Settings → Developer settings → Personal access tokens**, or, after a device
|
|
256
|
+
sign-in, revoke the OAuth App under **Settings → Applications → Authorized OAuth Apps**.
|
|
257
|
+
|
|
258
|
+
## Links
|
|
259
|
+
|
|
260
|
+
- [Configuration](https://github.com/joe-broadhead/opencode-github/blob/HEAD/docs/configuration.md): options,
|
|
261
|
+
toolsets, permission rules and error codes.
|
|
262
|
+
- [Scripting](https://github.com/joe-broadhead/opencode-github/blob/HEAD/docs/scripting.md): calling GitHub's reads
|
|
263
|
+
from scripts, with no model.
|
|
264
|
+
- [Security](https://github.com/joe-broadhead/opencode-github/blob/HEAD/SECURITY.md): network endpoints,
|
|
265
|
+
credentials, untrusted content and reporting a vulnerability.
|
|
266
|
+
- [Contributing](https://github.com/joe-broadhead/opencode-github/blob/HEAD/CONTRIBUTING.md): development, checks
|
|
267
|
+
and releases.
|
|
268
|
+
- [Changelog](https://github.com/joe-broadhead/opencode-github/blob/HEAD/CHANGELOG.md).
|
|
269
|
+
- [Issues](https://github.com/joe-broadhead/opencode-github/issues).
|
|
270
|
+
|
|
271
|
+
MIT licensed. See [LICENSE](https://github.com/joe-broadhead/opencode-github/blob/HEAD/LICENSE).
|