You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Setup:**Works automatically if OpenCode has Copilot configured and logged in.
119
+
**Setup:**Personal Copilot usage works automatically when OpenCode has Copilot configured and logged in.
120
120
121
-
**Optional:**For more reliable quota reporting, provide a fine-grained PAT:
121
+
**Personal usage:**No extra setup required. The plugin uses OpenCode auth to query your user billing report.
122
122
123
-
1. Create a fine-grained PAT at GitHub with **Account permissions > Plan > Read**
124
-
2. Create `copilot-quota-token.json` under OpenCode's runtime config directory (see `opencode debug paths`):
123
+
**Organization usage:** Create `copilot-quota-token.json` under OpenCode's runtime config directory (see `opencode debug paths`).
124
+
125
+
Organization example:
125
126
126
127
```json
127
128
{
128
129
"token": "github_pat_...",
129
-
"tier": "pro"
130
+
"tier": "business",
131
+
"organization": "your-org-slug"
130
132
}
131
133
```
132
134
133
-
`username` is optional (kept for backwards compatibility). If provided, it is used only as a fallback for legacy GitHub REST paths.
135
+
For organization-managed Copilot plans such as `business` or `enterprise`, `organization` is required. `username` is optional and is only used as the `?user=` filter on the organization report.
134
136
135
-
Both fine-grained PATs (`github_pat_...`) and classic PATs (`ghp_...`) should work. Fine-grained PATs must include **Account permissions > Plan > Read**.
137
+
-**Organization PAT permission:** fine-grained PAT with **Organization permissions > Administration > Read**.
If both OpenCode Copilot auth and `copilot-quota-token.json` are present, the plugin uses the PAT config first.
142
+
143
+
For personal plans, a PAT is optional. Use it only if you want an explicit tier override for quota totals.
144
+
145
+
Run `/quota_status` and check `copilot_quota_auth` to confirm `pat_state`, `pat_organization`, candidate paths checked, and `effective_source`/`override`.
139
146
</details>
140
147
141
148
<details>
@@ -386,7 +393,8 @@ After configuration, instruct the user to:
386
393
387
394
-**Toast not showing**: Run `/quota_status` to diagnose
388
395
-**Google Antigravity not working**: Ensure `opencode-antigravity-auth` plugin is installed and accounts are configured
389
-
-**Copilot quota unreliable**: Consider setting up a fine-grained PAT (see Provider-Specific Setup above)
396
+
-**Copilot quota unreliable**: For personal plans, OpenCode auth should work without extra setup; add `copilot-quota-token.json` only if you need a PAT-based override
397
+
-**Copilot organization-managed usage missing**: Add `"organization": "your-org-slug"` to `copilot-quota-token.json` so the plugin uses the organization billing report
0 commit comments