From 8bf74595660120c51a13aa6a18a09b912f4207c4 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Fri, 10 Jul 2026 12:38:32 +0200 Subject: [PATCH] feat(seo): account-management verbs (connect/accounts/forget) + connect.sh wrapper tokenstore remove/clear, fetch.sh forget dispatch, and a connect.sh wrapper that sources ~/.claude/.env internally and runs from any project. /seo now routes connect|accounts|forget before the audit flow; Makefile seo-connect delegates to the wrapper. Labels are guarded to shell-safe ASCII (POSIX case, whole-string, C-locale) as defense-in-depth; forget output states local removal is not a Google-side revocation. --- Makefile | 5 +-- lib/seo-data/README.md | 29 +++++++++++--- lib/seo-data/connect.sh | 45 +++++++++++++++++++++ lib/seo-data/fetch.sh | 18 ++++++++- lib/seo-data/seo-data.test.sh | 74 ++++++++++++++++++++++++++++++++++- lib/seo-data/tokenstore.py | 71 ++++++++++++++++++++++++++------- skills/seo/SKILL.md | 43 +++++++++++++++++++- 7 files changed, 258 insertions(+), 27 deletions(-) create mode 100644 lib/seo-data/connect.sh diff --git a/Makefile b/Makefile index 8e04472..5f503b7 100644 --- a/Makefile +++ b/Makefile @@ -25,9 +25,8 @@ onboard: link ## Onboard an existing project (run from the project directory) seo-connect: ## Connect a Google account for /seo FULL (creates venv, OAuth consent) @python3 -m venv "$$HOME/.claude/.venv-seo-data" @"$$HOME/.claude/.venv-seo-data/bin/pip" install -q -r lib/seo-data/requirements.txt - @bash -c 'set -a; [ -f "$$HOME/.claude/.env" ] && . "$$HOME/.claude/.env"; set +a; \ - read -r -p "Label for this account (e.g. client-a): " label; \ - "$$HOME/.claude/.venv-seo-data/bin/python3" lib/seo-data/connect.py --label "$$label"' + @bash -c 'read -r -p "Label for this account (e.g. client-a): " label; \ + bash lib/seo-data/connect.sh --label "$$label"' test: ## Run deterministic tests (lib/tests/*.test.sh + lib/gitflow-test.sh + lib/tests/run-*.sh) @fail=0; for t in lib/tests/*.test.sh lib/seo-data/*.test.sh lib/gitflow-test.sh lib/tests/run-*.sh; do \ diff --git a/lib/seo-data/README.md b/lib/seo-data/README.md index 560fbb4..b730beb 100644 --- a/lib/seo-data/README.md +++ b/lib/seo-data/README.md @@ -18,14 +18,19 @@ is written to disk during an audit, only at `make seo-connect`. One-time per Google account: ```bash -make seo-connect +make seo-connect # from the claude-config repo +bash ~/.claude/lib/seo-data/connect.sh --label