Google Search Console
Overview
Use the bundled dependency-free Node.js CLI for every Google Search Console API operation. This skill is read-only and supports exact property discovery, normalized performance queries, and reproducible JSON snapshots.
Privacy model
Require each user to create their own Google Desktop OAuth client; never distribute shared OAuth credentials with this skill. Keep credentials, tokens, aliases, and snapshots outside repositories under ~/.config/codex-gsc and ~/.local/share/codex-gsc by default. Treat property identifiers, queries, URLs, and metrics as private business data.
Requirements
- Node.js 22 or newer.
- A Google account with Search Console access.
- A user-owned Desktop OAuth client with the Search Console API enabled.
Setup
Resolve SKILL_DIR to the absolute directory containing this SKILL.md; do not assume the user's current working directory is the skill directory. Run commands as node "$SKILL_DIR/scripts/gsc.mjs" ....
Read references/oauth-setup.md, then run:
node "$SKILL_DIR/scripts/gsc.mjs" doctor
node "$SKILL_DIR/scripts/gsc.mjs" auth
Workflow
Always run node "$SKILL_DIR/scripts/gsc.mjs" doctor before querying.
If ready is false, do not run data commands. Read references/oauth-setup.md, explain each reported blocker, and guide the user through creating their own Desktop OAuth client. Never ask the user to paste a client secret, authorization code, or token into chat.
Pause while the user completes the Google Cloud steps. After they confirm the client file is installed, run node "$SKILL_DIR/scripts/gsc.mjs" auth interactively, rerun doctor, and require ready: true. Never create credentials for the user, reuse another person's client, or start interactive authorization from unattended automation.
Run node "$SKILL_DIR/scripts/gsc.mjs" sites and use the exact property identifier returned by the API, such as sc-domain:example.com or https://www.example.com/.
Add a stable alias when useful: node "$SKILL_DIR/scripts/gsc.mjs" alias --name example --site sc-domain:example.com.
For repeatable analysis, prefer a snapshot:
node "$SKILL_DIR/scripts/gsc.mjs" snapshot --site example --days 28
Read the emitted snapshot path and report its source, fetchedAt, property, period, data state, and row counts. Read references/output-schema.md when interpreting or transforming snapshot data.
Commands
doctor: inspect credential/token readiness without revealing secrets.
auth: perform the one-time Desktop OAuth loopback flow with the read-only Search Console scope.
refresh: force a refresh-token exchange and print only the new expiry metadata; use this to verify unattended access.
sites: list accessible Search Console properties and permission levels.
alias: save a local alias for an exact property identifier.
query: fetch one dimension set; prefer --output to a path outside repositories. Use --stdout only when the user explicitly accepts that raw query/page data may enter terminal or automation logs.
snapshot: fetch summary, date, query, page, and query+page datasets into one versioned JSON snapshot.
latest: locate the last successful local snapshot for a property.
Run node "$SKILL_DIR/scripts/gsc.mjs" help for complete flags.
Output
Snapshots record the exact property, Pacific-time period, search type, data state, normalized datasets, row counts, pagination, truncation, and completeness. Use the summary dataset for authoritative totals. Read references/output-schema.md before interpreting or transforming snapshot data.
Data limitations
- Default to finalized web-search data for the 28-day window ending three Pacific-time days ago.
- Treat query/page results as top-row evidence, not a complete census. Search Console applies internal data limits even when pagination succeeds.
- Use the summary dataset for aggregate totals. Do not sum query or page rows and present the result as an authoritative property total.
- Query+page requests are relatively expensive. Cache a daily snapshot and avoid repeatedly requesting the same window.
- Preserve exact property identifiers. Do not silently convert between Domain and URL-prefix properties.
- Never print client secrets, access tokens, or refresh tokens.
- Never commit OAuth files, tokens, aliases containing private property names, or raw snapshots to a repository.
- Treat property identifiers, search queries, page URLs, and performance metrics as private business data even though they are not OAuth secrets.
- Do not weaken the CLI's private-file permission or repository-path checks. Ask the user to move sensitive files instead.
Automation Fallback
For unattended jobs, use this order:
- Fresh API snapshot created during the current run.
latest successful API snapshot, explicitly marked stale with its fetch time.
- Existing manual export, explicitly marked with its path and age.
- No-op when the available evidence is too stale or weak.
Do not claim live GSC data unless the current API request succeeded.
Troubleshooting
- If
doctor reports unsafe permissions, move credentials outside repositories and set mode 0600 on macOS or Linux.
- If Google does not return a refresh token, revoke the prior grant and repeat
auth with consent.
- If a property is missing, verify the signed-in Google account and permission level; do not rewrite its identifier.
- If totals differ from query/page sums, use
summary: query and page datasets are limited Top-row evidence.
1---2name: google-search-console3description: Fetch, normalize, cache, and inspect Google Search Console performance data through the Search Console API. Use when Codex needs to authenticate a local GSC integration, list accessible properties, analyze clicks/impressions/CTR/position by query, page, date, country, device, or combined dimensions, replace manual GSC XLSX exports, or supply reproducible GSC evidence to SEO automations across multiple websites.4---56# Google Search Console78## Overview910Use the bundled dependency-free Node.js CLI for every Google Search Console API operation. This skill is read-only and supports exact property discovery, normalized performance queries, and reproducible JSON snapshots.1112## Privacy model1314Require each user to create their own Google Desktop OAuth client; never distribute shared OAuth credentials with this skill. Keep credentials, tokens, aliases, and snapshots outside repositories under `~/.config/codex-gsc` and `~/.local/share/codex-gsc` by default. Treat property identifiers, queries, URLs, and metrics as private business data.1516## Requirements1718- Node.js 22 or newer.19- A Google account with Search Console access.20- A user-owned Desktop OAuth client with the Search Console API enabled.2122## Setup2324Resolve `SKILL_DIR` to the absolute directory containing this `SKILL.md`; do not assume the user's current working directory is the skill directory. Run commands as `node "$SKILL_DIR/scripts/gsc.mjs" ...`.2526Read [references/oauth-setup.md](references/oauth-setup.md), then run:2728```bash29node "$SKILL_DIR/scripts/gsc.mjs" doctor30node "$SKILL_DIR/scripts/gsc.mjs" auth31```3233## Workflow34351. Always run `node "$SKILL_DIR/scripts/gsc.mjs" doctor` before querying.362. If `ready` is false, do not run data commands. Read [references/oauth-setup.md](references/oauth-setup.md), explain each reported blocker, and guide the user through creating their own Desktop OAuth client. Never ask the user to paste a client secret, authorization code, or token into chat.373. Pause while the user completes the Google Cloud steps. After they confirm the client file is installed, run `node "$SKILL_DIR/scripts/gsc.mjs" auth` interactively, rerun `doctor`, and require `ready: true`. Never create credentials for the user, reuse another person's client, or start interactive authorization from unattended automation.384. Run `node "$SKILL_DIR/scripts/gsc.mjs" sites` and use the exact property identifier returned by the API, such as `sc-domain:example.com` or `https://www.example.com/`.395. Add a stable alias when useful: `node "$SKILL_DIR/scripts/gsc.mjs" alias --name example --site sc-domain:example.com`.406. For repeatable analysis, prefer a snapshot:4142 `node "$SKILL_DIR/scripts/gsc.mjs" snapshot --site example --days 28`43447. Read the emitted snapshot path and report its `source`, `fetchedAt`, property, period, data state, and row counts. Read [references/output-schema.md](references/output-schema.md) when interpreting or transforming snapshot data.4546## Commands4748- `doctor`: inspect credential/token readiness without revealing secrets.49- `auth`: perform the one-time Desktop OAuth loopback flow with the read-only Search Console scope.50- `refresh`: force a refresh-token exchange and print only the new expiry metadata; use this to verify unattended access.51- `sites`: list accessible Search Console properties and permission levels.52- `alias`: save a local alias for an exact property identifier.53- `query`: fetch one dimension set; prefer `--output` to a path outside repositories. Use `--stdout` only when the user explicitly accepts that raw query/page data may enter terminal or automation logs.54- `snapshot`: fetch summary, date, query, page, and query+page datasets into one versioned JSON snapshot.55- `latest`: locate the last successful local snapshot for a property.5657Run `node "$SKILL_DIR/scripts/gsc.mjs" help` for complete flags.5859## Output6061Snapshots record the exact property, Pacific-time period, search type, data state, normalized datasets, row counts, pagination, truncation, and completeness. Use the `summary` dataset for authoritative totals. Read [references/output-schema.md](references/output-schema.md) before interpreting or transforming snapshot data.6263## Data limitations6465- Default to finalized web-search data for the 28-day window ending three Pacific-time days ago.66- Treat query/page results as top-row evidence, not a complete census. Search Console applies internal data limits even when pagination succeeds.67- Use the summary dataset for aggregate totals. Do not sum query or page rows and present the result as an authoritative property total.68- Query+page requests are relatively expensive. Cache a daily snapshot and avoid repeatedly requesting the same window.69- Preserve exact property identifiers. Do not silently convert between Domain and URL-prefix properties.70- Never print client secrets, access tokens, or refresh tokens.71- Never commit OAuth files, tokens, aliases containing private property names, or raw snapshots to a repository.72- Treat property identifiers, search queries, page URLs, and performance metrics as private business data even though they are not OAuth secrets.73- Do not weaken the CLI's private-file permission or repository-path checks. Ask the user to move sensitive files instead.7475## Automation Fallback7677For unattended jobs, use this order:78791. Fresh API snapshot created during the current run.802. `latest` successful API snapshot, explicitly marked stale with its fetch time.813. Existing manual export, explicitly marked with its path and age.824. No-op when the available evidence is too stale or weak.8384Do not claim live GSC data unless the current API request succeeded.8586## Troubleshooting8788- If `doctor` reports unsafe permissions, move credentials outside repositories and set mode `0600` on macOS or Linux.89- If Google does not return a refresh token, revoke the prior grant and repeat `auth` with consent.90- If a property is missing, verify the signed-in Google account and permission level; do not rewrite its identifier.91- If totals differ from query/page sums, use `summary`: query and page datasets are limited Top-row evidence.