Skip to content

About

GitHub management plugin for Google Antigravity (IDE / Desktop / CLI) — manage repos, PRs, Issues, Actions & Releases via zero-plaintext gh OAuth + official GitHub MCP + 4-tier Turbo guardrails | Antigravity 管理 GitHub 全能安全插件

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

agy-github logo

agy-github

Manage GitHub Safely Inside Google Antigravity — Zero-Plaintext OAuth, Official GitHub MCP (48+ Tools) & 4-Tier Turbo Guardrails

Version CI GitHub Stars Node.js >= 20 Runtime Deps Platforms MIT License

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, and agy-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 fetch
Natively trusts NODE_EXTRA_CA_CERTS
46+ Official Tools + github_api
Hot-loads via notifications/tools/list_changed
4-Tier PreToolUse
Forces force_ask on risky ops, deny on token leaks

What You Can Manage in Antigravity

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 fixes 404 Dynamic Client Registration (DCR) failures against https://api.githubcopilot.com/mcp/ by reusing your OS-keyring gh OAuth session and hot-loading 46+ official GitHub MCP tools.
  • Works cleanly inside Windows sandbox proxies: Fixes gh.exe x509: certificate signed by unknown authority errors in sandboxed terminals via github_api, powered by Node fetch that natively trusts NODE_EXTRA_CA_CERTS.
  • Safe under Turbo auto-execution: Deterministic 4-tier PreToolUse guardrails keep reads and feature-branch collaboration frictionless, enforce force_ask before irreversible actions, and hard-deny accidental token exfiltration.

Everyday GitHub Management Workflows

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

Quick Start

Prerequisites: Node.js >= 20 and GitHub CLI (gh).

1. Install the Plugin

Windows (PowerShell):

irm https://raw.githubusercontent.com/Nodifferentiable/agy-github/main/install.ps1 | iex

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/Nodifferentiable/agy-github/main/install.sh | sh
Alternative install options (local clone, per-project install, standalone MCP clients, agy CLI, or ask Antigravity)

Local clone (cross-platform)

git clone https://github.com/Nodifferentiable/agy-github.git
cd agy-github
node scripts/install.mjs install

Per-project install (repository-scoped .agents/plugins/agy-github)

node scripts/install.mjs install --project /path/to/your-repo

Standalone MCP clients (Claude Code, Codex, Cursor, etc.)

node scripts/install.mjs mcp-config

Antigravity CLI

agy plugin install /path/to/agy-github
agy plugin enable agy-github

Let Antigravity install it directly

Clone 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.

2. One-Time Browser OAuth Login

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"

3. Verify Inside Antigravity

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.


Architecture & Comparison

agy-github zero-plaintext OAuth bridge and 4-tier guardrail architecture

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

4-Tier PreToolUse Safety Model

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

Defense-in-Depth Runtime Protections

  • Subshell & wrapper unwrapping: Recursively inspects $(...), backtick substitutions, cmd /c, sh -c / bash -c, powershell -Command, and decodes UTF-16LE Base64 -EncodedCommand (or forces force_ask if opaque).
  • SSRF & cross-origin redirect protection: scripts/mcp-server.mjs enforces a strict host allowlist (api.github.com for REST/GraphQL, api.githubcopilot.com for remote MCP) with redirect: "manual", re-validating every redirect hop and paginated Link rel="next" URL before sending Authorization: Bearer.
  • Error redaction & UTF-8 safe bounding: Scrubs any token patterns or Bearer headers from error output (redactSecrets) and bounds large responses safely on UTF-8 boundaries (maxOutputBytes, default 65536 bytes).

Tool & Capability Catalog

Built-in Eager Tools (mcp_config.json)

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

Proxied Official GitHub Remote MCP Tools (46+ Lazy-Loaded Tools)

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.


Policy & CLI Reference

Daily Prompts Inside Antigravity

  • "Run github_doctor to 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-fix branch, commit the changes without touching .env, push, and open a PR."

Terminal Management CLI (scripts/install.mjs)

# 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 doctor

Policy File & Environment Variables

Settings 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)

Direct --cli Mode (Swarm & Automation)

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 } }"

FAQ & Troubleshooting

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.


Antigravity Plugins & Skills Suite

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

Contributing, Security & Star Support

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!

About

GitHub management plugin for Google Antigravity (IDE / Desktop / CLI) — manage repos, PRs, Issues, Actions & Releases via zero-plaintext gh OAuth + official GitHub MCP + 4-tier Turbo guardrails | Antigravity 管理 GitHub 全能安全插件

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages