name: connect-google description: Connect + use the customer's real Google Workspace (Gmail, Calendar, Drive, Sheets, Docs). Trigger when the user asks to read mail, check calendar, find Drive files, summarize a Sheet, send mail, or "nối Google". Google only — other services get their own connect-* skill.
Uses Hermes' builtin google-workspace skill as the engine. This layer adds Vietnamese voice + guardrails + connect orchestration (sovereign: everything stays on the customer's VPS).
explorer.connect_data), NOT connected + lesson not done → guide the connect (lesson beat 4). Only place to proactively offer.Creds are already in env. Each terminal call is a fresh shell → always use the FULL command below; never set a $GAPI var then reuse it; never read the builtin source/lib/; never run identity.py/whereami.py for Google tasks.
| User asks | Command |
|---|---|
| read / summarize email | python3 ~/.hermes/skills/productivity/google-workspace/scripts/google_api.py gmail search "in:inbox" --max 5 |
| unread mail | python3 ~/.hermes/skills/productivity/google-workspace/scripts/google_api.py gmail search "is:unread" --max 5 |
| one message detail | python3 ~/.hermes/skills/productivity/google-workspace/scripts/google_api.py gmail get <id> |
| send mail | python3 ~/.hermes/skills/productivity/google-workspace/scripts/google_api.py gmail send --to <a> --subject <s> --body <b> |
| upcoming calendar | python3 ~/.hermes/skills/productivity/google-workspace/scripts/google_api.py calendar list --max 5 |
| Drive files | python3 ~/.hermes/skills/productivity/google-workspace/scripts/google_api.py drive search "<keyword>" |
| read a Sheet | python3 ~/.hermes/skills/productivity/google-workspace/scripts/google_api.py sheets get <id> (extract id from URL) |
| read a Doc | python3 ~/.hermes/skills/productivity/google-workspace/scripts/google_api.py docs get <id> |
Other operations (create calendar event, edit/append a Sheet, share/upload a Drive file, reply/label mail, append a Doc, etc.): google_api.py is self-documenting — run python3 ~/.hermes/skills/productivity/google-workspace/scripts/google_api.py <service> --help (service = gmail|calendar|drive|sheets|docs) to see every command + args. Use that instead of guessing or reading the builtin source.
Run one command → read JSON → reply in natural Vietnamese + remind to verify (human-in-the-loop). Write actions (send mail, create event, edit Sheet) → summarize for the user and get confirmation BEFORE running.
🛑 Connecting is multi-turn and the Console UI specifics matter. Do NOT improvise steps, do NOT
find/explore the filesystem, do NOT callsetup.pydirectly, do NOT use the builtin google-workspace setup text. Just run the orchestratorlib/connect_next.pyand relay itsmessageto the user VERBATIM (it's already Vietnamese, with links). It tracks state and uses the right python internally.
You arrive here when a Google task returned NOT_AUTHENTICATED / No client secret stored, or the user asked to connect (admin/CEO only — connection is company-level).
python3 lib/connect_next.py → JSON {stage, message}. Send the message field to the user EXACTLY / verbatim — keep every URL as full plain text (Telegram auto-links it). 🚫 Do NOT reword, summarize, shorten, renumber, or turn URLs into hyperlink labels like "[Link]". Copy it character-for-character.stage after the user replies:need_oauth_client → the user will send a JSON file or paste their Client ID + Secret. When they do → if it's an attached file, save it and run python3 lib/connect_next.py --secret <saved-path>; if they pasted JSON text, run python3 lib/connect_next.py --secret '<the json>'. Then relay the new message.need_consent → the user opens the link, approves, and pastes back the localhost:1/... URL. When they paste it → run python3 lib/connect_next.py --code "<that URL>" → relay.connected → done — relay the success message.error → relay the message (it tells the user what to resend/retry).connect_next.py command and relay its message. You never improvise; the orchestrator owns the steps.