Manage GitHub Safely Inside Google Antigravity — Zero-Plaintext OAuth, Official GitHub MCP (48+ Tools) & 4-Tier Turbo Guardrails
English · 简体中文 · What You Can Manage · Quick Start · Architecture · 4-Tier Guardrails · Tool Reference · Policy & CLI · FAQ
Part of Antigravity Plugins & Skills Suite — One-command installer & toolkit alongside
agy-memory-harness,agy-context-monitor,agy-cua-desktop, andagy-github.
agy-github connects Google Antigravity (Desktop 2.0, CLI agy, and IDE) to your full GitHub account through GitHub CLI (gh) OS-keyring OAuth, a zero-dependency local Node.js MCP bridge to GitHub's official remote MCP (https://api.githubcopilot.com/mcp/), a sandbox-safe REST/GraphQL client (github_api), and deterministic 4-tier PreToolUse safety guardrails.
| Plaintext Tokens on Disk | Windows Sandbox Proxy TLS | Official Remote MCP + REST/GraphQL | Turbo Mode Safety |
|---|---|---|---|
| 0 OAuth lives in OS Credential Manager / Keychain |
Node fetchNatively trusts NODE_EXTRA_CA_CERTS |
46+ Official Tools + github_apiHot-loads via notifications/tools/list_changed |
4-Tier PreToolUseForces force_ask on risky ops, deny on token leaks |
If you use Google Antigravity (Desktop 2.0, CLI agy, or IDE) as your daily AI coding agent, agy-github gives Antigravity full control over your GitHub workflow without sacrificing credential hygiene or safety:
- No plaintext PATs in
mcp_config.json: Avoids static tokens on disk and fixes404Dynamic Client Registration (DCR) failures againsthttps://api.githubcopilot.com/mcp/by reusing your OS-keyringghOAuth session and hot-loading 46+ official GitHub MCP tools. - Works cleanly inside Windows sandbox proxies: Fixes
gh.exex509: certificate signed by unknown authorityerrors in sandboxed terminals viagithub_api, powered by Nodefetchthat natively trustsNODE_EXTRA_CA_CERTS. - Safe under
Turboauto-execution: Deterministic 4-tierPreToolUseguardrails keep reads and feature-branch collaboration frictionless, enforceforce_askbefore irreversible actions, and hard-denyaccidental token exfiltration.
| Workflow | What Antigravity Can Do for You |
|---|---|
| Repositories & Account | Audit public & private repos, inspect Stars/topics/API quotas, create repos, and manage visibility, archiving, or transfers (with force_ask confirmation) |
| Branches, Commits & PRs | Create feature branches, commit/push changes cleanly, open & update Pull Requests, inspect diffs, reply to code reviews, and merge PRs safely |
| Issues & Code Search | Search code, commits, and Issues across GitHub, triage Issues, add labels/comments, and organize sub-issues |
| GitHub Actions CI/CD | Inspect workflow runs and job status, troubleshoot failing builds/tests, check workflow permissions, and trigger workflow_dispatch |
| Releases & Publishing | Tag semver versions, draft bilingual changelogs, and publish official GitHub Releases with native force_ask sign-off |
Turbo Guardrails & Secrets |
Zero popups for reads & feat/* branches; strict confirmation on main/Secrets/Keys/Webhooks/visibility; hard deny on printing tokens or reading hosts.yml |
Prerequisites: Node.js >= 20 and GitHub CLI (gh).
Windows (PowerShell):
irm https://raw.githubusercontent.com/Nodifferentiable/agy-github/main/install.ps1 | iexmacOS / Linux:
curl -fsSL https://raw.githubusercontent.com/Nodifferentiable/agy-github/main/install.sh | shAlternative install options (local clone, per-project install, standalone MCP clients, agy CLI, or ask Antigravity)
git clone https://github.com/Nodifferentiable/agy-github.git
cd agy-github
node scripts/install.mjs installnode scripts/install.mjs install --project /path/to/your-reponode scripts/install.mjs mcp-configagy plugin install /path/to/agy-github
agy plugin enable agy-githubClone https://github.com/Nodifferentiable/agy-github.git into ~/.gemini/config/plugins/agy-github, run `node ~/.gemini/config/plugins/agy-github/scripts/install.mjs install`, and verify with github_doctor.
Run the bundled login helper once in your terminal (this also configures git HTTPS credentials via gh auth setup-git):
Windows (PowerShell):
& "$env:USERPROFILE\.gemini\config\plugins\agy-github\login.ps1"macOS / Linux:
sh "$HOME/.gemini/config/plugins/agy-github/login.sh"Ask Antigravity to run github_doctor (or invoke /github). Once authenticated, agy-github hot-loads all official remote GitHub MCP tools alongside github_doctor and github_api without restarting Antigravity.
| Dimension | Raw Remote serverUrl |
Static PAT in mcp_config.json |
Bare gh.exe in Windows Sandbox |
agy-github v0.1.0 |
|---|---|---|---|---|
| OAuth Support | Fails when remote MCP lacks DCR (404) |
Manual copy-paste | Works outside sandbox only | One-click gh auth login --web + auto hot-load |
| Secret Storage | Token cache files | Plaintext token on disk | OS credential store | OS Credential Manager / Keychain (0 plaintext on disk) |
| Windows Sandbox TLS | N/A | N/A | Go gh.exe ignores SSL_CERT_FILE (x509 error) |
Node fetch honors NODE_EXTRA_CA_CERTS |
| Repo Settings / Pagination | Limited | Manual curl | Fails in Windows sandbox | github_api REST (auto Link pagination) + GraphQL |
Turbo Mode Safety |
None | None | None | 4-Tier PreToolUse + subshell unwrapping + SSRF guard |
Designed specifically for autonomous Turbo workflows (rules/AGENTS.md soft guidance + hooks.json hard enforcement across run_command, mcp_agy-github_github_*, call_mcp_tool, mcp_agy-fast_fast_run_checks, and mcp_agy-fast_fast_apply_edits.verify):
| Tier | Covered Operations | Hook Output | Effect |
|---|---|---|---|
| Tier 0 · Read & Diagnostics | Repo/PR/Issue/Actions reads, git status/diff/log/clone/fetch, github_doctor, github_api (GET/HEAD / GraphQL query) |
{"decision":"allow"} |
Zero prompt friction |
| Tier 1 · Feature Branch Work | Creating branches, pushing feat/* / fix/*, opening Issues/PRs, creating private repos (private: true) or draft releases |
{"decision":"allow"} |
Allowed smoothly; AGENTS.md enforces clean commits |
| Tier 2 · High-Risk / Irreversible | Deleting/archiving/renaming/transferring repos, changing visibility, creating public repos, git push -f / -uf / --all / +ref / :ref, writing to main/master/prod/production/release, merging PRs, editing Secrets/Keys/Webhooks/Environments/Rulesets, publishing non-draft Releases |
force_ask |
Ignores cached approvals & Turbo mode — always shows native confirmation |
| Tier 3 · Token Exfiltration | Printing gh auth token, gh auth status --show-token, git credential fill, reading hosts.yml / mcp_oauth_tokens.json, reading GH_TOKEN / GITHUB_TOKEN / AGY_GITHUB_TOKEN |
deny |
Hard-blocked so tokens never enter chat or cloud context |
- Subshell & wrapper unwrapping: Recursively inspects
$(...), backtick substitutions,cmd /c,sh -c/bash -c,powershell -Command, and decodes UTF-16LE Base64-EncodedCommand(or forcesforce_askif opaque). - SSRF & cross-origin redirect protection:
scripts/mcp-server.mjsenforces a strict host allowlist (api.github.comfor REST/GraphQL,api.githubcopilot.comfor remote MCP) withredirect: "manual", re-validating every redirect hop and paginatedLink rel="next"URL before sendingAuthorization: Bearer. - Error redaction & UTF-8 safe bounding: Scrubs any token patterns or
Bearerheaders from error output (redactSecrets) and bounds large responses safely on UTF-8 boundaries (maxOutputBytes, default65536bytes).
| Tool | Purpose | Key Parameters |
|---|---|---|
github_doctor |
Inspects gh CLI path/version, authenticated login & OAuth scopes, API quota, remote MCP connection/tool count, git credential helpers, and effective guardrail policy (token masked). |
refresh?: boolean |
github_api |
Executes any GitHub REST v3 request or GraphQL v4 query/mutation via sandbox-safe Node fetch. |
method, endpoint, query, body, graphql, variables, paginate, maxPages |
Once authenticated, https://api.githubcopilot.com/mcp/ tools hot-load automatically covering repositories, branches, commits, files (create_or_update_file, push_files, delete_file), Issues, Pull Requests (create_pull_request, merge_pull_request, reviews), code search, users/teams, releases/tags, and Copilot/security scanning. Optional toolset filtering is supported via AGY_GITHUB_TOOLSETS or toolsets in policy.json.
- "Run
github_doctorto verify my GitHub login, OAuth scopes, and remote MCP tools." - "List my recent public and private repositories along with open PRs using
github_api." - "Create a
feat/ci-fixbranch, commit the changes without touching.env, push, and open a PR."
# Inspect active guardrail policy
node ~/.gemini/config/plugins/agy-github/scripts/install.mjs policy --show
# Allow direct pushes to main on solo repos while keeping PR merge & delete prompts
node ~/.gemini/config/plugins/agy-github/scripts/install.mjs policy --confirm-main off --confirm-merge on
# Customize protected branches or UTF-8 output limit (4096..524288 bytes)
node ~/.gemini/config/plugins/agy-github/scripts/install.mjs policy --protected-branches main,master,release --max-bytes 65536
# Reset overrides back to strict defaults
node ~/.gemini/config/plugins/agy-github/scripts/install.mjs policy --reset
# Full plugin + LS + gh + git diagnostics
node ~/.gemini/config/plugins/agy-github/scripts/install.mjs doctorSettings file: ~/.gemini/config/agy-github-policy.json (or ${PLUGIN_DATA}/policy.json):
| Key | Default | Description |
|---|---|---|
protectedBranches |
["main","master","prod","production","release"] |
Branches triggering force_ask on direct push/write |
confirmProtectedBranchWrite |
true |
Require force_ask when pushing/writing to protected branches |
confirmPullRequestMerge |
true |
Require force_ask on merge_pull_request / gh pr merge |
confirmRepoVisibilityChange |
true |
Require force_ask on visibility changes & public repo creation |
confirmRepoDeleteOrTransfer |
true |
Require force_ask on repo delete/archive/rename/transfer |
confirmForcePushAndRefDelete |
true |
Require force_ask on --force / -uf / +ref / :ref |
confirmSecretsAndSecurity |
true |
Require force_ask on Secrets/Keys/Webhooks/Environments/Rulesets |
confirmPublicRelease |
true |
Require force_ask on non-draft Release creation or deletion |
blockTokenExfiltration |
true |
Hard deny commands exposing GitHub tokens or hosts.yml |
maxOutputBytes |
65536 |
UTF-8 byte ceiling (4096..524288; override via AGY_GITHUB_MAX_BYTES) |
Subagents without MCP access can invoke the bridge directly (still audited by PreToolUse when run via run_command or agy-fast):
node ~/.gemini/config/plugins/agy-github/scripts/mcp-server.mjs --cli doctor
node ~/.gemini/config/plugins/agy-github/scripts/mcp-server.mjs --cli api GET "/user/repos?sort=updated&per_page=10"
node ~/.gemini/config/plugins/agy-github/scripts/mcp-server.mjs --cli graphql "query { viewer { login } }"1. gh fails with x509 certificate errors in Antigravity's Windows sandbox
This is expected when gh.exe runs inside a sandboxed local proxy whose CA is passed via NODE_EXTRA_CA_CERTS / SSL_CERT_FILE. Use github_api instead of shelling out to gh api — github_api uses Node's fetch which honors NODE_EXTRA_CA_CERTS.
2. Only 2 tools appear at first before login
When unauthenticated, agy-github intentionally degrades cleanly to github_doctor and github_api. Run login.ps1 / login.sh, wait a few seconds (or call github_doctor(refresh: true)), and the bridge automatically sends notifications/tools/list_changed to hot-load all 46+ official remote MCP tools.
3. How do I inspect the skill and agent rules shipped with the plugin?
See rules/AGENTS.md for the always-on routing & hygiene rules and skills/github/SKILL.md for the /github runbook.
Explore the full first-party Antigravity plugin suite via Antigravity Plugins & Skills Suite (Nodifferentiable/antigravity-plugins):
| Repository | Role | Highlights |
|---|---|---|
| antigravity-plugins | Flagship Suite Hub | One-command interactive installer (suite.mjs), skill-only meta-plugin, cross-plugin playbooks & engineering standards |
| agy-memory-harness | Cognition & Memory (v0.4.0) |
Live session-following trajectory inspector with Chinese translation, Project <-> Global skill/rule workbench & 5-track memory |
| agy-context-monitor | Compute & Cache (v1.0.0) |
Exact context window fill, 3-way cache hit rate, 1:0.1:5 API-equivalent credits, tok/s speed & Windows topbar capsule |
| agy-cua-desktop | Desktop & Browser (v0.2.0) |
5-tier script-first, background-first desktop GUI & logged-in Chrome/Edge automation with <150 ms COM probe |
| agy-github (This Repo) | GitHub & Guardrails (v0.1.0) |
Zero-plaintext gh OAuth bridge to Official Remote MCP (46+ tools), sandbox-safe github_api & 4-tier Turbo guardrails |
If agy-github saves you from token headaches or risky Turbo mishaps, please consider giving the repo a ⭐ on GitHub — it helps more Antigravity developers discover it!