Repository avatar
Other Tools
v0.1.2
active

gemini-hub

io.github.qwnzkkldsfai/gemini-hub

Zero-latency context bridge across Antigravity IDE, Gemini Web/Desktop, and Google Drive & Docs

Documentation

⚡ Gemini_Hub

Zero-latency, cross-platform context bridge across Antigravity IDE, Gemini Web, Gemini Desktop, Chrome Sidebar, and Gemini Mobile App.

English 简体中文 CI Status MIT License Python 3.10+ Chrome MV3 Official MCP Registry VaultGraph Core (MIT MCP) Public Live Survival Telemetry & Pro Kits

Official MCP Registry · Related Open-Core & Pro Companion Tools · VaultGraph Core (MIT MCP) · Live Survival Telemetry & Pro Kits · Ko-fi Store · Gumroad


Why Gemini_Hub?

Developers constantly switch between Antigravity (across multiple workstations and windows), Gemini Web (gemini.google.com), Gemini Desktop, Gemini in Chrome Sidebar, and Gemini Mobile App. While Gemini surfaces share cloud chat history, they are isolated from your local IDE engineering context:

ApproachAntigravity → Gemini LatencyDrive ClutterGemini / Mobile → AntigravityCloud Auth Setup
Manual Copy & PasteRepetitive, breaks flowNoneManualNone
Creating a new Google Doc per turn1–3 min Drive search indexing lagHundreds of duplicate filesNo (@Google Drive is read-only)Tedious OAuth setup
⚡ Gemini_Hub0.05s via Alt+Shift+J or fixed-file Drive overwriteZero (1 fixed Now whiteboard + per-repo archive)< 50ms queued multi-note auto-injectionZero-OAuth when Drive Desktop is mounted

Architecture Overview

flowchart LR
    subgraph AG["Antigravity (Multi-Window / Multi-PC)"]
        AG_In["SessionStart / PreInvocation Hook (<50ms, Anti-Steal Guard)"]
        AG_Out["Stop Hook (Windowless Async Delta Worker)"]
    end

    subgraph Hub["Google Drive Shared Hub (Zero-OAuth Local Sync OR Pure API Mirror)"]
        Inbox["inbox/*.md & *.txt (Multi-Note Queue + Recall)"]
        NowMD["⚡ Gemini Hub - Now.md (Fixed File In-Place Overwrite)"]
        ProjMD["projects/📁 <Project>.md (Per-Repo Rolling History)"]
        Archive["archive/ (Session Logs & Consumed Notes)"]
    end

    subgraph Gem["Gemini Surfaces"]
        GChrome["Gemini Web (Right-Aligned ⚡ Pill & /hub + Tab)"]
        GDesk["Gemini Desktop & Chrome Sidebar (Alt+Shift+J / H Hotkeys)"]
        GMobile["Gemini Mobile App (Share Sheet -> Save .txt to inbox)"]
    end

    AG_Out -->|"Turn-aligned Q->A + 3-entry rolling overwrite"| NowMD
    AG_Out -->|"Per-workspace history"| ProjMD
    NowMD -->|"Alt+Shift+J (0.05s paste) / /hub+Tab / @Google Drive"| GChrome
    NowMD -->|"Alt+Shift+J (0.05s paste) / @Google Drive"| GDesk
    GChrome -->|"⚡ Send to Hub pill / Alt+Shift+S selection"| Inbox
    GDesk -->|"Copy + Alt+Shift+H"| Inbox
    GMobile -->|"iOS Shortcut / Android Save to Drive"| Inbox
    Inbox -->|"Batched System Message injection (<50ms) -> archive"| AG_In

Key Capabilities

  1. Zero-OAuth Native Drive Sync (LocalSyncBackend):
    • Automatically detects mounted Google Drive directories on Windows (G:\My Drive / localized folders), macOS (~/Library/CloudStorage/GoogleDrive-*), and Linux (rclone / gvfs / Insync). Reuses your existing Drive Desktop login to sync ⚡ Gemini Hub - Now.md in-place—no Google Cloud Console setup required!
    • Also includes a clientless PureAPIBackend (using Drive API changes.list incremental mirroring to ~/.cache/gemini-hub/mirror/) for headless/clientless Linux workstations.
  2. Turn-Aligned Multi-Turn Summarizer (summarizer.py):
    • Reads only newly appended bytes of transcript.jsonl, pairs user intents with AI conclusions within the same turn (preserving the last 3 [Turn 1..3] Q -> A exchanges), supports optional Gemini Flash LLM summarization via GEMINI_API_KEY, and degrades gracefully to a zero-cost deterministic rule engine.
    • Wraps injected context in <antigravity_context>...</antigravity_context> tags so Gemini cleanly separates background IDE state from your current prompt.
  3. Kernel-Level Zero-Lag Symmetric Hotkeys (Alt + Shift + J Copy Context / Alt + Shift + H Push):
    • Uses native Win32 user32.RegisterHotKey on Windows (zero low-level WH_KEYBOARD_LL keyboard hooks—never stalls the OS input queue):
    • Alt + Shift + J: Instantly copies your latest <antigravity_context> block to the clipboard so you can Ctrl+V / Cmd+V into Gemini Web, Gemini Desktop, or Chrome Sidebar!
    • Alt + Shift + H: Copy any text in Gemini Desktop, Chrome Sidebar, or another app and press Alt + Shift + H to push it straight into the Antigravity inbox.
  4. Multi-Note Queue, One-Click Recall & Multi-Window Anti-Steal Guard:
    • Push multiple notes in a row—they queue chronologically in inbox/ and merge into a single structured Note #1..#N System Message on your next Antigravity prompt (with one-click ↩ Recall in the extension popup to undo the latest unread note).
    • Multi-Window Anti-Steal Protection: Background Antigravity windows running autonomous /goal tool loops (invocationNum > 1) never snatch untargeted inbox notes meant for the foreground window where you next press Enter.
  5. Truly Windowless Detached Daemon:
    • Running gemini-hub daemon automatically detaches invisibly in the background (pythonw.exe on Windows, start_new_session on macOS/Linux) and returns your terminal prompt in < 0.5s—closing the terminal never kills the daemon, and zero black CMD windows ever flash.
  6. Chrome MV3 Extension, Mobile Share-to-Drive & MCP Server:
    • Right-aligned ⚡ Send to Hub pill on completed gemini.google.com replies (waits cleanly during streaming and adapts to Light/Dark themes);
    • /hub + Tab inline 0ms context expansion inside Gemini's prompt editor;
    • Native .txt & .md inbox ingestion so you can drop ideas from Gemini Mobile App (iOS Shortcuts / Android Save to Drive) while away from your desk;
    • Standard stdio MCP Server (gemini-hub mcp) for Claude Code, Cursor, and Gemini Desktop.

3-Minute Installation & Deployment

Step 1: Install the CLI

Using uv (recommended, includes global hotkeys, LLM summarizer, and desktop notifications):

# Install directly from GitHub:
uv tool install "gemini-hub[all] @ git+https://github.com/qwnzkkldsfai/Gemini_Hub.git"

# Or install from a local clone (Tip: omit `-e` on Windows if the folder path contains non-ASCII characters):
uv tool install "./Gemini_Hub[all]"

Or via pipx: pipx install "git+https://github.com/qwnzkkldsfai/Gemini_Hub.git".

Step 2: Initialize & Register Antigravity Hooks

gemini-hub init

This detects your Google Drive sync mount, creates GeminiHub/{inbox,archive,projects,state}, and non-destructively merges gemini-hub-sync into ~/.gemini/config/hooks.json (preserving any existing hooks).

Step 3: Start the Windowless Background Daemon (& Optional Login Autostart)

# Detaches invisibly in the background and returns your terminal prompt immediately:
gemini-hub daemon

# Optional: auto-start silently on OS login (Windows Startup / Task Scheduler fallback, macOS LaunchAgent, Linux systemd):
gemini-hub service install

Lifecycle management commands:

gemini-hub daemon status     # Check PID, health, storage mode, and unread inbox count
gemini-hub daemon restart    # Restart background daemon
gemini-hub daemon stop       # Stop background daemon cleanly
gemini-hub doctor            # Run 5-point end-to-end health diagnostics

Step 4: Load & Pin the Chrome / Edge / Brave Companion Extension (Manifest V3)

  1. Open chrome://extensions (or edge://extensions) and enable Developer mode (top right).
  2. Click Load unpacked and select the extension/ directory in this repository.
  3. Click the 🧩 Extensions puzzle icon in your browser toolbar and click 📌 Pin next to Gemini Hub Companion to keep the blue-and-gold ⚡ icon visible.
  4. Refresh any open https://gemini.google.com tab (F5) once. (Zero "scripting" tab-injection permissions—100% safe alongside Chrome's Auto Browse / Glic Side Panel!)

Daily Workflows Across All Devices

1. Bring Antigravity Context into Gemini (3 Ways)

Every time an Antigravity turn finishes, the Stop hook updates your local cache and GeminiHub/⚡ Gemini Hub - Now.md. In Gemini:

  • Method A — Press Alt + Shift + J (Works in Web, Gemini Desktop & Chrome Sidebar): Press Alt + Shift + J (or click 📋 Copy Now Context in the ⚡ toolbar popup) to copy your latest <antigravity_context> block, then press Ctrl+V / Cmd+V inside any Gemini chat box!
  • Method B — Type /hub + Tab on gemini.google.com: Typing /hub in the Gemini Web prompt shows a subtle floating pill; press Tab to expand your latest context inline in < 10ms.
  • Method C — Cloud @Google Drive Lookup (Cross-Device / Mobile): Run gemini-hub skill to copy a safety-compliant Saved Info note and open Gemini Saved Info (or create a custom Gem), then ask @Google Drive to read Gemini Hub Now (or attach ⚡ Gemini Hub - Now.md via + → Add from Drive).

2. Send Context Back to Antigravity (5 Entry Points, Supports Multi-Note Queuing)

Queue one or many notes—on your next prompt in Antigravity, all queued notes are merged in chronological order and injected automatically in < 50ms:

  1. Gemini Web Inline Pill: Click the right-aligned ⚡ Send to Hub button beneath any completed Gemini response.
  2. Chrome Native Sidebar (Gemini in Chrome / Auto Browse) Combo:
    • Sessions using Chrome's privileged Auto Browse side panel often do not appear in gemini.google.com web history. Click the native 📋 Copy icon in the Sidebar, then either:
      • Press Alt + Shift + H directly, OR
      • Click the toolbar ⚡ icon → 📥 Paste Clipboard → Ctrl + Enter to bundle the Sidebar reply together with the active left-tab URL and an optional note!
  3. Any Webpage Selection: Highlight text on GitHub or docs and right-click → ⚡ Send to Gemini Hub (or copy and press Alt + Shift + S; click ↩ Recall in the popup to undo the latest unread note).
  4. Gemini Desktop / Native Apps: Copy text and press Alt + Shift + H.
  5. Gemini Mobile App (iPhone / Android Away from Desk):
    • iOS: Create a 2-action Shortcut enabled in the Share Sheet (Receive Text from Share Sheet → Save File to Google Drive/GeminiHub/inbox/mobile_date.txt). Tap Share → Send to Gemini Hub on any mobile Gemini reply!
    • Android: Tap Share → Save to Drive into GeminiHub/inbox/ as .txt or .md.
    • Google Drive syncs your mobile notes to your PC in the background, ready for automatic injection as soon as you sit back down at Antigravity!

Multi-PC Sync & Linux Clientless Mode

  • Multi-PC Sync (Windows / macOS / Linux with Drive Mount): Sign into the same Google Drive account on your second machine, install gemini-hub, and run gemini-hub init + gemini-hub daemon. Both machines automatically share the same whiteboard and inbox/!
  • Linux Wayland & Clientless PureAPIBackend (Optional Google Cloud OAuth):
    • Wayland Shortcut: Bind a desktop keyboard shortcut in GNOME / KDE / Hyprland / Sway to gemini-hub push --clipboard (auto-probes wl-paste → xclip → xsel); Alt + Shift + S inside Chrome works natively on Wayland.
    • Clientless pure_api Mode: On machines without a local Drive sync client, enable Google Drive API and Google Docs API in Google Cloud Console, create an OAuth Client ID of application type Desktop app, download the JSON to ~/Downloads, and simply run:
      gemini-hub auth
      
      gemini-hub automatically discovers the newest client_secret_*.json in ~/Downloads and completes browser authorization ($0 cost, least-privilege drive.file scope).

MCP Server Integration (Claude Code / Cursor / Gemini Desktop)

Local CLI (stdio)

{
  "mcpServers": {
    "gemini-hub": {
      "command": "gemini-hub",
      "args": ["mcp"]
    }
  }
}

Docker MCP Quickstart (Zero Local Python Install)

docker run -i --rm \
  -e GEMINI_HUB_CONFIG_DIR=/data/config \
  -e GEMINI_HUB_CACHE_DIR=/data/cache \
  -v gemini-hub-data:/data \
  ghcr.io/qwnzkkldsfai/gemini-hub:0.1.2

Or configure the container directly in mcpServers:

{
  "mcpServers": {
    "gemini-hub": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "GEMINI_HUB_CONFIG_DIR=/data/config",
        "-e", "GEMINI_HUB_CACHE_DIR=/data/cache",
        "-v", "gemini-hub-data:/data",
        "ghcr.io/qwnzkkldsfai/gemini-hub:0.1.2"
      ]
    }
  }
}

Exposes save_handoff, get_now_context, and list_inbox over standard JSON-RPC 2.0 stdio.


Security & Privacy

  • Loopback-Only & Origin Guard: The HTTP daemon binds strictly to 127.0.0.1:18765, requires Bearer token authentication, blocks /api/v1/shutdown from browser origins, and rejects untrusted web Origin headers with 403 Forbidden.
  • Zero Credential Leakage: Configurations and optional tokens live in OS-standard user config directories (0600 permissions on POSIX) and are excluded via .gitignore. The Chrome extension requests only 127.0.0.1:18765 and gemini.google.com—never <all_urls>.

Related Open-Core & Pro Companion Tools

Gemini_Hub stays scoped to MIT-licensed local and Google Drive context bridging (hooks, background daemon, Chrome MV3 extension, and stdio MCP). Related open-core tools and optional companion packages:

Project / ChannelScope & Technical DetailsLinks
VaultGraph Core (MIT Sibling MCP)AGPL-free static dependency/AST license scanner (license-audit), local Graph+RRF sample retrieval harness (eval --golden --corpus sample), and zero-dependency JSON-RPC 2.0 stdio MCP server (mcp-stdio). Official MCP Registry: io.github.qwnzkkldsfai/vaultgraph-core (v0.1.5, active).GitHub Repo
mcpguard-core (MIT Sibling MCP)Zero-dependency pre-flight MCP tool-poisoning & secret-leak scanner (scan-text, scan-tools), signed .mcpb desktop extension builder, and JSON-RPC 2.0 stdio server (mcp-stdio). Official MCP Registry: io.github.qwnzkkldsfai/mcpguard-core (v0.1.3, active).GitHub Repo
Public Live Survival Telemetry & Pro KitsPublic operational telemetry ledger, 16 Live Client Demos, and optional Pro companion kits, including the Connect-RPC awakener (--auto-wake), Sidecar permission compiler, git-worktree branch isolation and circuit-breaker kits, plus turnkey VaultGraph appliances.Telemetry & Pro Kits · 16 Live Client Demos
StorefrontsOptional packaged Pro kits (Gemini Hub Pro Kit, War-Room Blueprint, VaultGraph Appliance / Pro, and bundle tiers).Ko-fi Store · Tier A $79 · Gumroad

1-line uvx quickstart for VaultGraph Core (no local clone required; replace self-check with mcp-stdio for MCP clients):

uvx --from "git+https://github.com/qwnzkkldsfai/vaultgraph-core" vaultgraph-core self-check

License

Released under the MIT License. See CONTRIBUTING.md for development and testing guidelines.


Need Custom MCP Integration for your team's IDE hooks, Google Drive pipelines, or private workflows? Support ongoing maintenance via Ko-fi or request a custom build on Ko-fi Commissions.