Skip to content

Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.

fix(gws): save OAuth URL to file and open with macOS open command

Jeremy Dawesabba6ea97fa1
diff --git a/plugins/integrations/skills/gws-install/SKILL.md b/plugins/integrations/skills/gws-install/SKILL.md
index 0ef1af82..550ccf07 100644
--- a/plugins/integrations/skills/gws-install/SKILL.md
+++ b/plugins/integrations/skills/gws-install/SKILL.md
@@ -83,13 +83,21 @@ export GOOGLE_WORKSPACE_CLI_CLIENT_SECRET="your-client-secret"
Ask which Google account to use, then:
-1. **Capture the auth URL** — run the login command and extract the URL:
+1. **Capture the auth URL** — run the login command, extract the URL, and save it to a file the user can open:
```bash
-gws auth login -s gmail,drive,calendar,sheets,docs,chat,tasks 2>&1 | head -5
+gws auth login -s gmail,drive,calendar,sheets,docs,chat,tasks 2>&1 | tee /tmp/gws-auth-output.txt &
+sleep 2
+grep -o 'https://accounts.google.com[^ ]*' /tmp/gws-auth-output.txt > /tmp/gws-auth-url.txt
```
-2. **Present the URL to the user** — copy the full `https://accounts.google.com/...` URL from the output and paste it as text in your response so the user can click it. Terminal output may wrap or truncate long URLs, making them impossible to copy.
+2. **Open or present the URL** — the OAuth URL is extremely long (30+ scopes). Terminal wrapping makes it impossible to copy. Save it and open it:
+
+```bash
+cat /tmp/gws-auth-url.txt | xargs open
+```
+
+If `open` fails, tell the user: "The auth URL is saved at `/tmp/gws-auth-url.txt` — open that file and copy the URL from there."
3. **Wait for the user** to approve in their browser, then verify:
diff --git a/plugins/integrations/skills/gws-setup/SKILL.md b/plugins/integrations/skills/gws-setup/SKILL.md
index 5528ec23..cea49e51 100644
--- a/plugins/integrations/skills/gws-setup/SKILL.md
+++ b/plugins/integrations/skills/gws-setup/SKILL.md
@@ -136,15 +136,24 @@ Recommend **full access** for power users. The OAuth consent screen shows all re
**IMPORTANT**: This step is interactive — it prints a URL the user must open in their browser. Do NOT run as a background task or sub-agent. Run in foreground.
-1. Run the login command:
+1. Run the login command and capture the output:
```bash
-gws auth login --full
+gws auth login --full 2>&1 | tee /tmp/gws-auth-output.txt &
+sleep 2
# Or with specific services:
-gws auth login -s gmail,drive,calendar,sheets,docs,chat,tasks
+# gws auth login -s gmail,drive,calendar,sheets,docs,chat,tasks 2>&1 | tee /tmp/gws-auth-output.txt &
```
-2. The command prints a long OAuth URL. **Copy the full URL from the output and paste it in your response** so the user can click it — terminal wrapping can truncate it, making it impossible to copy from the terminal directly.
+2. The OAuth URL is extremely long (30+ scopes). Terminal wrapping makes it impossible to copy. Capture it and open directly:
+
+```bash
+# Extract URL from output and open in browser
+grep -o 'https://accounts.google.com[^ ]*' /tmp/gws-auth-output.txt > /tmp/gws-auth-url.txt
+cat /tmp/gws-auth-url.txt | xargs open
+```
+
+If `open` fails, tell the user: "The auth URL is saved at `/tmp/gws-auth-url.txt` — open that file and copy the URL."
3. Wait for the user to approve in their browser.