gemini-task-bridge
Health Uyari
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 7 GitHub stars
Code Gecti
- Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
Unofficial macOS bridge that lets Claude Code, Codex, Antigravity and T3 Code create and use Gemini Desktop Task chats (zero-dependency MCP server + CLI)
gemini-task-bridge
English | 简体中文
Bridge Claude Code, Codex, Antigravity, and T3 Code directly to Google Gemini Desktop (Gemini.app) Task mode via a local stdio MCP server and CLI—so your coding AI can create dedicated Gemini conversations, send tasks, and read verified replies automatically. macOS only (requires Python 3.9+ with zero third-party dependencies and Gemini.app). Unofficial community tool—not affiliated with, endorsed by, or supported by Google.
Verification status: Offline unit tests and stdio MCP regression suites cover Python 3.9 (pure stdlib) and Python 3.12. Real-host end-to-end acceptance across Codex, Claude Code, and Antigravity is tracked in mcp-and-multi-agent.md.
3-Minute Quickstart (macOS)
Only the background LaunchAgent needs macOS Accessibility permission—Claude Code, Codex, Antigravity, and your terminal do not.
Easiest path: install the skill, then ask your AI agent (Claude Code, Codex, or Antigravity) to "install and set up gemini-task-bridge". It follows
SKILL.mdand runs every step below for you; you only togglePython.appon in System Settings → Accessibility.
1. Install the bridge scripts & CLI
git clone https://github.com/xsj0413abc-ui/gemini-task-bridge.git
cd gemini-task-bridge
bash skills/gemini-task-bridge/scripts/install.sh
If ~/.local/bin is not in your PATH, add it to ~/.zshrc and reload your shell:
export PATH="$HOME/.local/bin:$PATH"
2. Grant Accessibility permission to Python.app
install.sh prints a resolved single-link TCC Python path (.../Python.app/Contents/MacOS/Python).
- Open System Settings → Privacy & Security → Accessibility and enable that exact
Python.app(not/usr/bin/python3). - If your project folders live in
~/Desktop,~/Documents, or~/Downloads, enable the samePython.appin Full Disk Access.
3. Install and verify the background service
gemini-task-bridge service install
gemini-task-bridge doctor
doctor checks daemon → daemon_accessibility → screen → gemini in order and tells you the exact next step if anything is not ready. Make sure Gemini.app is running and all checks show green (ready: true in doctor --json).
4. Register MCP (and optional Skill) in your AI host
Register the stdio MCP server with --scope <host> so each host has its own isolated pairs (up to 10 AI-created pairs per scope):
- Claude Code:
claude mcp add --transport stdio --scope user gemini-task-bridge -- \ "$HOME/.local/bin/gemini-task-bridge" mcp --scope claude-code - Codex:
codex mcp add gemini-task-bridge -- \ "$HOME/.local/bin/gemini-task-bridge" mcp --scope codex - Antigravity (
~/.gemini/config/mcp_config.json):
Replace<ABS_PATH_TO_BIN>with the output ofdirname "$(command -v gemini-task-bridge)"(never put unexpanded$HOMEinside JSON):{ "mcpServers": { "gemini-task-bridge": { "command": "<ABS_PATH_TO_BIN>/gemini-task-bridge", "args": ["mcp", "--scope", "antigravity"] } } }
Optional — install the Agent Skill so your AI knows the full diagnostic and dispatch workflow:
npx skills add xsj0413abc-ui/gemini-task-bridge
Or in Claude Code Plugin Marketplace:
/plugin marketplace add xsj0413abc-ui/gemini-task-bridge
/plugin install gemini-task-bridge@gemini-task-bridge
5. Open a new session and run your first task
Start a fresh session in your AI host and ask it to create a Gemini conversation and run a check, for example:
"Use gemini-task-bridge to create a Gemini Task conversation named
Code Reviewerand ask it to review/abs/path/to/spec.md."
Your AI will call gemini_pair_init (executed silently by the background daemon), then gemini_send → gemini_wait → gemini_read.
Key Features (v2.2.0)
- AI Self-Service Conversation Creation (Background Control Plane):
gemini_pair_initandgemini_list_chats(plus CLIpair init/pair gemini-chats) submit requests to the privileged LaunchAgent over an atomic control queue—so AI hosts never need macOS Accessibility permission.- Per-scope quota of 10 enabled pairs prevents runaway chat creation, with idempotent request keys and crash-safe startup recovery.
- Human-Readable Bilingual Errors & Stage-by-Stage
doctor:- Every CLI and MCP error includes a plain-language
messageand actionablefixin Chinese or English (controlled byGEMINI_TASK_BRIDGE_LANG=zh|en, falling back toLANG/LC_ALL, defaulten). gemini-task-bridge doctorevaluates background daemon health (daemon → daemon_accessibility → screen → gemini → ok).
- Every CLI and MCP error includes a plain-language
- Multi-Host Scoped Stdio MCP Server (
gemini-task-bridge mcp):- Zero-dependency Python 3.9+ stdlib JSON-RPC 2.0 supporting MCP
2025-06-18,2025-03-26(batch), and2024-11-05. --scope <name>isolates pairs and tasks per host; accepts both snake_case and camelCase IDs (pair_id/pairId,task_id/taskId,idempotency_key/idempotencyKey); defaults to--adapter-filter localso T3 production pairs stay untouched.
- Zero-dependency Python 3.9+ stdlib JSON-RPC 2.0 supporting MCP
- Crash-Safe Queues & Zero Focus Hijacking:
- 3-phase hidden staging +
atomic_rename_excl(st_nlink == 1), pre-AXdispatchingintent with Step C re-lock verification, and silentAXValue/AXPressinjection without stealing clipboard or focus.
- 3-phase hidden staging +
- Bilingual
needs_attentionDetection & TCC Hardening:- Detects English and Simplified Chinese
Needs attention/需要注意badges and confirmation cards without auto-approving. - Binds LaunchAgent to a single-hardlink
Python.appbinary to prevent macOStccdmisattribution to/usr/bin/git, and guards against conflicting LaunchAgents targeting the same data root.
- Detects English and Simplified Chinese
T3 Code Integration (adapter=t3)
T3 Code users get full 1-to-1 bidirectional thread delivery via the official t3 thread send CLI, preserving flat sent/<taskId>.json + sent/<taskId>.receipt.json archives and instant rollback to native T3 threads. (t3 CLI is only required when using adapter=t3 pairs.)
# Create a 1-to-1 T3 Code <-> Gemini Task pair
gemini-task-bridge pair init \
--id "t3_reviewer" \
--adapter t3 \
--t3-thread "<target-t3-thread-id>" \
--reply-to "<orchestrator-t3-thread-id>" \
--gemini-title "T3 Code Reviewer" \
--workspace "/abs/path/to/project"
# Dispatch a task (replies return to --reply-to automatically)
gemini-task-bridge send --pair t3_reviewer --message "Inspect /abs/path/to/spec.md"
# Emergency rollback / per-pair routing
gemini-task-bridge mode t3-all # Route all t3 pairs back to T3; pause local pairs
gemini-task-bridge mode hybrid # Restore per-pair routing
gemini-task-bridge pair route t3_reviewer t3 # Switch a single t3 pair
Advanced: Least-Privilege Isolation (--allow-pairs)
By default, gemini-task-bridge mcp --scope <host> lets that host see pairs it created (ownerScope == scope). If you want to restrict an agent to specific pre-created pairs—or grant a scoped host read/write access to a shared pair—add --allow-pairs:
# Restrict a project agent strictly to one pre-created local pair (no --scope)
gemini-task-bridge mcp --adapter-filter local --allow-pairs reviewer
# Or grant a scoped host access to its own pairs PLUS a shared pair
gemini-task-bridge mcp --scope claude-code --allow-pairs shared_reviewer
Empty, blank, or malformed --allow-pairs values fail closed at startup (exit 2). See mcp-and-multi-agent.md for host-native TOML/JSON templates and full tool schemas.
Upgrading from t3-gemini-bridge
v2.2.0 renames the project from t3-gemini-bridge to gemini-task-bridge with zero-migration backwards compatibility:
- CLI:
~/.local/bin/gemini-task-bridgeis installed alongside a silentt3-gemini-bridgecompatibility wrapper. - Data root: Automatically continues using
~/.local/share/t3-gemini-bridgeif it already exists and~/.local/share/gemini-task-bridgedoes not (no data is moved). - Environment variables & LaunchAgent: All
GEMINI_TASK_BRIDGE_*variables fall back toT3_GEMINI_BRIDGE_*, and existing LaunchAgent labels targeting the same root are preserved (conflicting labels are blocked safely withconflicting_launchagent_for_root).
See cli-reference.md for the full compatibility matrix and macos-permissions-and-troubleshooting.md for the v2.0 production cutover SOP.
Architecture
Claude Code / Codex / Antigravity / T3 Code
│
├──(MCP stdio / CLI: pair init, list_chats)──▶ control/inbox/*.json ─────────┐
└──(MCP stdio / CLI: send, task wait|read)───▶ inbox/*.task.json ────────────┤
▼
`sent/payloads/` (local) / LaunchAgent Daemon (Python.app)
`t3 thread send` (t3) ◀── outbox/<taskId>.json ◀───────── AXValue + AXPress (silent)
(or AX reply capture) Gemini.app (Task Mode)
Repository Structure
gemini-task-bridge/
├── .claude-plugin/ # Claude Code plugin & marketplace manifests
├── .github/workflows/ci.yml # Python 3.12 & pure-stdlib Python 3.9 CI
├── skills/gemini-task-bridge/
│ ├── SKILL.md # Agent Skill operating manual
│ ├── agents/openai.yaml # UI metadata & invocation policy
│ ├── references/ # CLI, MCP, macOS TCC/troubleshooting & safety docs
│ └── scripts/
│ ├── gemini_task_bridge.py # Bridge CLI, adapters, queues & LaunchAgent manager
│ ├── control_plane.py # Daemon control queue, quotas & crash recovery
│ ├── error_catalog.py # Bilingual human-readable error messages & fixes
│ ├── bridge_ax.py # macOS Accessibility & DiagnosticLogWatcher driver
│ ├── mcp_server.py # Zero-dependency stdlib stdio MCP server
│ └── install.sh # Atomic non-destructive local installer
└── tests/ # Offline unit & stdio MCP regression tests
Running Tests
python3 -B -m unittest discover -s tests -v
Security & Privacy Design
- Runtime directories are created with
0o700and state/control files with0o600underumask 0o077. - File reads reject symlinks (
O_NOFOLLOW+no_symlink()), verifyst_nlink == 1andst_uid == os.getuid(), and enforce strict byte/line limits. - Control requests are fully re-validated on the daemon side;
in_flightcreation crashes never blindly re-clickGemini.app. - Outbound receipts are stage-gated and cross-checked against frozen intake snapshots (
pairId,pairUid,adapter,replyThreadId).
License
MIT © 2026 xsj0413abc-ui
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi