Skip to content

Universal SEO skill for Claude Code. 26 sub-skills + 19 sub-agents covering technical SEO, E-E-A-T, schema, GEO/AEO, agent readiness (Lighthouse Agentic Browsing, WebMCP, llms.txt), backlinks, local SEO, e-commerce, international SEO, Google APIs, and PDF/Excel reporting. 9 optional extensions for live SEO data.

feat(seo-cockpit): 0.3.1 Google settings in /config, taller pane

Agrici Danielc13d8d1170c9
diff --git a/plugins/seo-cockpit/.claude-plugin/plugin.json b/plugins/seo-cockpit/.claude-plugin/plugin.json
index 3ded05d..804b8b3 100644
--- a/plugins/seo-cockpit/.claude-plugin/plugin.json
+++ b/plugins/seo-cockpit/.claude-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "seo-cockpit",
- "version": "0.3.0",
+ "version": "0.3.1",
"description": "Mods companion for claude-seo: a spend guard on paid SEO APIs, a live audit band with a receipt, an economy mode, a visual cockpit (Search Console, rankings, Core Web Vitals, audit, Maps, spend) and zero-token commands",
"author": {
"name": "Agrici Daniel"
@@ -49,6 +49,22 @@
"title": "Page for Core Web Vitals",
"description": "For the cockpit's Vitals and drift views: a URL or origin. Leave empty to use the Search Console property's site.",
"default": ""
+ },
+ "googleAccount": {
+ "type": "string",
+ "title": "Google account",
+ "description": "Which Google sign-in claude-seo uses for Search Console. auto: claude-seo's own order (its sign-in, then a service account, then your gcloud account). gcloud: always your account from 'gcloud auth application-default login', for properties you own.",
+ "options": [
+ "auto",
+ "gcloud"
+ ],
+ "default": "auto"
+ },
+ "googleApiKey": {
+ "type": "string",
+ "title": "Google API key",
+ "description": "For Core Web Vitals (CrUX) and PageSpeed. Kept in Claude Code's secure storage. Leave empty to use claude-seo's own setup.",
+ "sensitive": true
}
}
}
diff --git a/plugins/seo-cockpit/README.md b/plugins/seo-cockpit/README.md
index 4c6c5eb..d38afbb 100644
--- a/plugins/seo-cockpit/README.md
+++ b/plugins/seo-cockpit/README.md
@@ -55,7 +55,8 @@ r: Refresh e: Export
```
- **The site** comes from `/config` if you set one, else from the newest `<domain>-audit/` folder here. With neither, the pane asks for it in place and remembers it for this folder.
-- **Google access** uses claude-seo's own setup. If Search Console says "no access" but you own the property, your service account is not a user on it: either add it in Search Console, or use your own Google account with `gcloud auth application-default login --scopes=https://www.googleapis.com/auth/webmasters.readonly,https://www.googleapis.com/auth/cloud-platform` and start Claude Code with `CLAUDE_SEO_GOOGLE_AUTH=adc`. Core Web Vitals needs `GOOGLE_API_KEY`.
+- **Google access** uses claude-seo's own setup, or the two Google settings in `/config`. If Search Console says "no access" for a property you own, a service account is being used: set "Google account" to `gcloud` after `gcloud auth application-default login --scopes=https://www.googleapis.com/auth/webmasters.readonly,https://www.googleapis.com/auth/cloud-platform`. Core Web Vitals needs a Google API key ("Google API key" in `/config`).
+- **Where it sits:** in a normal terminal the pane opens above the prompt and asks for as many rows as the screen can spare (drag it to resize; your size is kept). In Claude Code's fullscreen layout, 110 columns or wider, it docks beside the conversation at full height.
- **Everything loads on open**, from free sources only (the audit and grid files, the cost ledger, and Search Console and CrUX through claude-seo's own Google setup). The last result shows at once and is replaced when the fresh one arrives.
- **Missing data stays visible** as a dim line saying what to do, instead of an error screen.
- **A row opens its detail** (Enter, a click, or its number): charts and tables for that source, `b` to go back.
@@ -93,6 +94,8 @@ Auto-update is off by default for third-party marketplaces. Run `claude plugin u
| Economy mode | off | Run the five Opus agents on Sonnet |
| Search Console property | empty | For the cockpit: `sc-domain:example.com` or `https://example.com/`. Empty uses claude-seo's default property |
| Page for Core Web Vitals | empty | For the Vitals and drift views. Empty uses the property's site |
+| Google account | auto | `auto`: claude-seo's own order (its sign-in, a service account, then your gcloud account). `gcloud`: always your own account from `gcloud auth application-default login`, for properties you own |
+| Google API key | empty | For Core Web Vitals (CrUX). Sensitive: kept in Claude Code's secure storage. Empty uses claude-seo's own setup |
## What it can and cannot see
diff --git a/plugins/seo-cockpit/hooks/lib/overview.ts b/plugins/seo-cockpit/hooks/lib/overview.ts
index c8a7a86..c6e695f 100644
--- a/plugins/seo-cockpit/hooks/lib/overview.ts
+++ b/plugins/seo-cockpit/hooks/lib/overview.ts
@@ -141,5 +141,6 @@ export function statusLine(host: string | null, rows: readonly Row[]): string |
const score = audit?.line.split(' · ')[0]
const cwv = vitals === undefined ? undefined : /^(poor|needs work)/.test(vitals.line) ? 'CWV needs work' : 'CWV good'
- return ['SEO', host, score === undefined ? undefined : `audit ${score}`, cwv].filter(Boolean).join(' · ')
+ // The engine prefixes the plugin's name; the line itself starts with the site.
+ return [host, score === undefined ? undefined : `audit ${score}`, cwv].filter(Boolean).join(' · ')
}
diff --git a/plugins/seo-cockpit/hooks/register.ts b/plugins/seo-cockpit/hooks/register.ts
index 88b0d24..c713582 100644
--- a/plugins/seo-cockpit/hooks/register.ts
+++ b/plugins/seo-cockpit/hooks/register.ts
@@ -32,6 +32,9 @@ type Ctx = {
site: string
pageUrl: string
pane: PaneState & { isOpen: boolean }
+ /** Google settings from /config, handed to claude-seo's scripts only. */
+ googleAccount: string
+ googleApiKey: string
/** What the person typed in the pane as the site, per working folder. */
typed: string | null
}
@@ -106,9 +109,18 @@ async function findRoot($: EngineInterface, ctx: Ctx): Promise<string | null> {
return null
}
+/** The environment claude-seo's scripts run with: its own runtime folder, plus the Google settings from /config. */
+function scriptEnv(ctx: Ctx, seoRoot: string): Record<string, string> {
+ return {
+ ...runtimeEnvOf(seoRoot),
+ ...(ctx.googleAccount === 'gcloud' && { CLAUDE_SEO_GOOGLE_AUTH: 'adc' }),
+ ...(ctx.googleApiKey !== '' && { GOOGLE_API_KEY: ctx.googleApiKey }),
+ }
+}
+
/** Runs one of claude-seo's stdlib-only scripts with the configured Python. */
async function runScript($: EngineInterface, ctx: Ctx, seoRoot: string, script: string, args: readonly string[]) {
- return $.process.run([ctx.python, joinPath(seoRoot, 'scripts', script), ...args], { timeoutMs: 20_000, env: runtimeEnvOf(seoRoot) })
+ return $.process.run([ctx.python, joinPath(seoRoot, 'scripts', script), ...args], { timeoutMs: 20_000, env: scriptEnv(ctx, seoRoot) })
}
/** Writes a guarded call's cost to the ledger. Never throws: the call already ran. */
@@ -278,7 +290,7 @@ async function restoreAudit($: EngineInterface, ctx: Ctx): Promise<void> {
/** Runs a claude-seo script through its managed runtime (for scripts that need its packages) and parses the JSON it prints. */
async function runtimeJson($: EngineInterface, ctx: Ctx, seoRoot: string, script: string, args: readonly string[]): Promise<{ data: unknown; error: string | null }> {
try {
- const { exitCode, stdout, stderr } = await $.process.run([ctx.python, joinPath(seoRoot, 'scripts', 'runtime.py'), 'run', script, ...args], { timeoutMs: 90_000, env: runtimeEnvOf(seoRoot) })
+ const { exitCode, stdout, stderr } = await $.process.run([ctx.python, joinPath(seoRoot, 'scripts', 'runtime.py'), 'run', script, ...args], { timeoutMs: 90_000, env: scriptEnv(ctx, seoRoot) })
try {
return { data: JSON.parse(stdout), error: null }
@@ -542,7 +554,9 @@ async function cockpitCommand($: EngineInterface, ctx: Ctx, args: string): Promi
await resolveHost($, ctx)
- const opened = await $.ui.open({ id: PANE_ID, title: 'SEO Cockpit', focus: true, rows: 14 })
+ // Ask for room: inline, the engine grants up to what the layout spares (a size the person set wins).
+ // Docked beside the transcript (fullscreen, 110+ columns), the pane is full height anyway.
+ const opened = await $.ui.open({ id: PANE_ID, title: 'SEO Cockpit', focus: true, rows: 40 })
if (opened.isPlaced) {
ctx.pane.isOpen = true
@@ -636,6 +650,8 @@ export function register(on: On, options: PluginOptions) {
pageUrl: typeof options.pageUrl === 'string' ? options.pageUrl.trim() : '',
pane: { view: 'overview', models: {}, loading: new Set(), host: null, hostSource: null, exported: null, isOpen: false },
typed: null,
+ googleAccount: typeof options.googleAccount === 'string' ? options.googleAccount : 'auto',
+ googleApiKey: typeof options.googleApiKey === 'string' ? options.googleApiKey.trim() : '',
}
// ------------------------------------------------------------ spend guard
diff --git a/plugins/seo-cockpit/tests/fixtures/world.ts b/plugins/seo-cockpit/tests/fixtures/world.ts
index 0c5db19..3205af7 100644
--- a/plugins/seo-cockpit/tests/fixtures/world.ts
+++ b/plugins/seo-cockpit/tests/fixtures/world.ts
@@ -8,6 +8,8 @@ import type { On } from 'claude-code'
export type World = {
/** Every argv the plugin ran, joined by spaces, after the interpreter. */
runs: string[]
+ /** The environment each run was given, in the same order. */
+ envs: Array<Readonly<Record<string, string>>>
/** Every question the plugin asked. */
asked: string[]
/** Calls that reached the tool beneath the plugin. */
@@ -31,7 +33,7 @@ export type Setup = {
}
export function worldOf(on: On, setup: Setup = {}): World {
- const world: World = { runs: [], asked: [], ran: [], commands: [] }
+ const world: World = { runs: [], envs: [], asked: [], ran: [], commands: [] }
// The kit's bottom hook throws for an event no stub answers; a session start needs one.
on('session.start', () => ({ cwd: '/work' }))
@@ -48,6 +50,7 @@ export function worldOf(on: On, setup: Setup = {}): World {
const sub = args[1] ?? ''
world.runs.push([script, ...args.slice(1)].join(' '))
+ world.envs.push(e.init?.env ?? {})
const reply = setup.scripts?.[sub]
diff --git a/plugins/seo-cockpit/tests/register.test.ts b/plugins/seo-cockpit/tests/register.test.ts
index d54bb62..3b6fb48 100644
--- a/plugins/seo-cockpit/tests/register.test.ts
+++ b/plugins/seo-cockpit/tests/register.test.ts
@@ -154,6 +154,28 @@ describe('spend guard', () => {
})
})
+describe('google settings', () => {
+ test('/config Google settings reach claude-seo\'s scripts, and only them', { options: { googleAccount: 'gcloud', googleApiKey: 'test-key' } }, async ($, on) => {
+ const world = worldOf(on, { scripts: { today: { stdout: {} }, summary: { stdout: {} } } })
+
+ await $.command.run(command('seo-spend'))
+
+ expect(world.envs[0]?.CLAUDE_SEO_GOOGLE_AUTH).toBe('adc')
+ expect(world.envs[0]?.GOOGLE_API_KEY).toBe('test-key')
+ // A checkout: claude-seo uses its own runtime folder, never this plugin's.
+ expect(world.envs[0]?.CLAUDE_PLUGIN_DATA).toBe('')
+ })
+
+ test('auto leaves claude-seo\'s own order alone', async ($, on) => {
+ const world = worldOf(on, { scripts: { today: { stdout: {} }, summary: { stdout: {} } } })
+
+ await $.command.run(command('seo-spend'))
+
+ expect(world.envs[0]?.CLAUDE_SEO_GOOGLE_AUTH).toBeUndefined()
+ expect(world.envs[0]?.GOOGLE_API_KEY).toBeUndefined()
+ })
+})
+
describe('commands', () => {
test('the start registers all three commands', async ($, on) => {
const world = worldOf(on)