From 751a9ed2d1c72d8ad1abf1915d6cc28c6bb9806f Mon Sep 17 00:00:00 2001 From: johnnyfish Date: Mon, 6 Apr 2026 00:46:34 +0300 Subject: [PATCH] fix(gmail): add OneCLI credential mode detection --- .claude/skills/add-gmail/SKILL.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.claude/skills/add-gmail/SKILL.md b/.claude/skills/add-gmail/SKILL.md index 781a0eb..099ec5b 100644 --- a/.claude/skills/add-gmail/SKILL.md +++ b/.claude/skills/add-gmail/SKILL.md @@ -85,11 +85,27 @@ All tests must pass (including the new Gmail tests) and build must be clean befo ls -la ~/.gmail-mcp/ 2>/dev/null || echo "No Gmail config found" ``` -If `credentials.json` already exists, skip to "Build and restart" below. +If `credentials.json` already exists with real tokens (not `onecli-managed` values), skip to "Build and restart" below. ### GCP Project Setup -Tell the user: +Check if OneCLI is configured: + +```bash +grep -q 'ONECLI_URL=.' .env 2>/dev/null && echo "onecli" || echo "manual" +``` + +**If OneCLI:** Tell the user to open `${ONECLI_URL}/connections?connect=gmail` to set up their Gmail connection. The dashboard walks them through creating a Google Cloud OAuth app and authorizing it. Ask them to let you know when done. + +Once the user confirms, run: + +```bash +onecli apps get --provider gmail +``` + +Check that `config.hasCredentials` is `true` or `connection` is not null. The response `hint` field has instructions and a docs URL for what stub credential files to create under `~/.gmail-mcp/`. Follow the hint — never overwrite existing files that don't contain `onecli-managed` values. + +**If manual:** Tell the user: > I need you to set up Google Cloud OAuth credentials: >