gsc-cli 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. gsc_cli-0.2.0/.claude-plugin/marketplace.json +15 -0
  2. gsc_cli-0.2.0/.github/workflows/publish.yml +18 -0
  3. gsc_cli-0.2.0/.gitignore +36 -0
  4. gsc_cli-0.2.0/CLAUDE.md +97 -0
  5. gsc_cli-0.2.0/LICENSE +21 -0
  6. gsc_cli-0.2.0/PKG-INFO +173 -0
  7. gsc_cli-0.2.0/README.md +140 -0
  8. gsc_cli-0.2.0/plugins/gsc-cli/.claude-plugin/plugin.json +24 -0
  9. gsc_cli-0.2.0/plugins/gsc-cli/LICENSE +21 -0
  10. gsc_cli-0.2.0/plugins/gsc-cli/README.md +85 -0
  11. gsc_cli-0.2.0/plugins/gsc-cli/skills/gsc-ai-mode-detect/SKILL.md +128 -0
  12. gsc_cli-0.2.0/plugins/gsc-cli/skills/gsc-ai-mode-detect/references/ai-mode-query-patterns.md +67 -0
  13. gsc_cli-0.2.0/plugins/gsc-cli/skills/gsc-analyze/SKILL.md +84 -0
  14. gsc_cli-0.2.0/plugins/gsc-cli/skills/gsc-audit/SKILL.md +79 -0
  15. gsc_cli-0.2.0/plugins/gsc-cli/skills/gsc-cannibalization/SKILL.md +140 -0
  16. gsc_cli-0.2.0/plugins/gsc-cli/skills/gsc-compare/SKILL.md +177 -0
  17. gsc_cli-0.2.0/plugins/gsc-cli/skills/gsc-core/SKILL.md +256 -0
  18. gsc_cli-0.2.0/plugins/gsc-cli/skills/gsc-inspect/SKILL.md +41 -0
  19. gsc_cli-0.2.0/plugins/gsc-cli/skills/gsc-opportunities/SKILL.md +275 -0
  20. gsc_cli-0.2.0/plugins/gsc-cli/skills/gsc-query/SKILL.md +43 -0
  21. gsc_cli-0.2.0/plugins/gsc-cli/skills/gsc-sitemaps/SKILL.md +47 -0
  22. gsc_cli-0.2.0/plugins/gsc-cli/skills/gsc-sites/SKILL.md +40 -0
  23. gsc_cli-0.2.0/pyproject.toml +75 -0
  24. gsc_cli-0.2.0/src/gsc/__init__.py +9 -0
  25. gsc_cli-0.2.0/src/gsc/auth.py +178 -0
  26. gsc_cli-0.2.0/src/gsc/benchmarks.py +34 -0
  27. gsc_cli-0.2.0/src/gsc/cli/__init__.py +3 -0
  28. gsc_cli-0.2.0/src/gsc/cli/auth_cmd.py +147 -0
  29. gsc_cli-0.2.0/src/gsc/cli/genai.py +240 -0
  30. gsc_cli-0.2.0/src/gsc/cli/inspect_cmd.py +26 -0
  31. gsc_cli-0.2.0/src/gsc/cli/main.py +52 -0
  32. gsc_cli-0.2.0/src/gsc/cli/multimodal.py +203 -0
  33. gsc_cli-0.2.0/src/gsc/cli/query.py +108 -0
  34. gsc_cli-0.2.0/src/gsc/cli/sitemaps.py +62 -0
  35. gsc_cli-0.2.0/src/gsc/cli/sites.py +54 -0
  36. gsc_cli-0.2.0/src/gsc/client.py +90 -0
  37. gsc_cli-0.2.0/src/gsc/data/seo-benchmarks.json +54 -0
  38. gsc_cli-0.2.0/src/gsc/formatters.py +55 -0
  39. gsc_cli-0.2.0/src/gsc/models.py +178 -0
  40. gsc_cli-0.2.0/tests/test_exports.py +80 -0
  41. gsc_cli-0.2.0/uv.lock +760 -0
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "seoconsult",
3
+ "owner": {
4
+ "name": "SEO Consult",
5
+ "url": "https://seoconsult.bg"
6
+ },
7
+ "description": "Claude Code plugins from SEO Consult.",
8
+ "plugins": [
9
+ {
10
+ "name": "gsc-cli",
11
+ "source": "./plugins/gsc-cli",
12
+ "category": "seo"
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,18 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ environment: pypi
11
+ permissions:
12
+ id-token: write
13
+ contents: read
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: astral-sh/setup-uv@v6
17
+ - run: uv build
18
+ - run: uv publish --trusted-publishing always
@@ -0,0 +1,36 @@
1
+ # === Secrets — NEVER commit these ===
2
+ client_secrets.json
3
+ credentials.json
4
+ *.secret.json
5
+ oauth/
6
+ .config/
7
+
8
+ # === Python ===
9
+ __pycache__/
10
+ *.py[cod]
11
+ *.egg-info/
12
+ .eggs/
13
+ build/
14
+ dist/
15
+ .venv/
16
+ venv/
17
+
18
+ # === Tooling caches ===
19
+ .ruff_cache/
20
+ .pytest_cache/
21
+ .mypy_cache/
22
+
23
+ # === Generated analysis artifacts (data dumps / reports) ===
24
+ *_data.json
25
+ *_report.txt
26
+ audit_*.json
27
+ canib_*.json
28
+ cannibal_*.json
29
+ cmp_*.json
30
+ kd_*.json
31
+ opp_*.json
32
+ sd_*.json
33
+ seoopt_*.json
34
+
35
+ # === Internal working docs (not for publication) ===
36
+ PROMOTION.md
@@ -0,0 +1,97 @@
1
+ # gsc-cli
2
+
3
+ A Google Search Console CLI that doubles as the backend for a set of Claude Code
4
+ SEO-analysis skills. Humans use it directly; skills shell out to the installed
5
+ `gsc` binary with `--format json` and reason over the output.
6
+
7
+ ## Quick start
8
+
9
+ ```bash
10
+ uv sync # create the venv + install deps + register `gsc`
11
+ uv run gsc auth login # OAuth2 browser flow -> saves the `default` profile
12
+ uv run gsc sites list # confirm access
13
+ uv run gsc --format json query https://www.example.com/ \
14
+ --start-date 2026-01-01 --end-date 2026-01-28 --dimensions query
15
+ ```
16
+
17
+ Set `GSC_CLIENT_SECRETS` to your OAuth2 `client_secrets.json` (downloaded from the
18
+ Google Cloud Console) before `gsc auth login`, or pass `--client-secrets`.
19
+
20
+ ## Project structure
21
+
22
+ ```
23
+ src/gsc/
24
+ __init__.py # __version__
25
+ models.py # API response dataclasses + Profile (from_api classmethods)
26
+ formatters.py # format_output -> json / table / csv
27
+ auth.py # OAuth2 + service-account creds, YAML profile store
28
+ client.py # GSCClient over webmasters v3 + searchconsole v1
29
+ cli/
30
+ main.py # root `cli` group, global --profile/--format/--verbose
31
+ auth_cmd.py # `gsc auth` (login, add-profile, list/remove-profile, status)
32
+ sites.py # `gsc sites` + shared get_client(ctx) factory
33
+ query.py # `gsc query` + parse_filter
34
+ sitemaps.py # `gsc sitemaps` (list, get, submit, delete)
35
+ inspect_cmd.py # `gsc inspect`
36
+ multimodal.py # `gsc multimodal` (UI export of Web: multimodal; not in the API)
37
+ genai.py # `gsc genai` (UI export of the Generative AI report + AI lift index)
38
+ .claude-plugin/ # marketplace.json, so `/plugin marketplace add` finds the plugin
39
+ plugins/gsc-cli/ # the Claude Code plugin: .claude-plugin/plugin.json + skills/
40
+ ```
41
+
42
+ ## Three-layer architecture
43
+
44
+ 1. **Core library** (`src/gsc/`) — `GSCClient` wraps the two discovery services;
45
+ methods return dataclasses parsed via `from_api`. `auth.py` resolves a
46
+ `Profile` to Google `Credentials`. `formatters.py` renders output.
47
+ 2. **Click CLI** (`src/gsc/cli/`) — a root group stashes global options in
48
+ `ctx.obj`; each data command sets `ctx.obj["site_url"]`, builds a client via
49
+ `get_client(ctx)`, flattens the returned dataclass to plain dicts, and calls
50
+ `format_output`.
51
+ 3. **Claude Code skills** (`plugins/gsc-cli/skills/`) — markdown files that invoke
52
+ `gsc --format json <command>` and analyze the JSON. They never touch the
53
+ Google API directly. `gsc-core` is an always-loaded reference; the rest are
54
+ user-triggered.
55
+
56
+ ## Multi-profile auth model
57
+
58
+ Profiles live in `~/.config/gsc/config.yaml` (override the directory with
59
+ `GSC_CONFIG_DIR`):
60
+
61
+ ```yaml
62
+ profiles:
63
+ default:
64
+ auth_type: oauth2
65
+ credentials: ~/.config/gsc/oauth/default.json
66
+ sites: []
67
+ client-acme:
68
+ auth_type: service_account
69
+ credentials: /keys/acme-sa.json
70
+ sites: ["https://www.acme.com/", "sc-domain:acme.com"]
71
+ ```
72
+
73
+ A command resolves its profile by precedence:
74
+
75
+ 1. explicit `--profile NAME` (or `$GSC_PROFILE`);
76
+ 2. otherwise, the profile whose `sites` list contains the target site URL
77
+ (auto-detection);
78
+ 3. otherwise, `default`.
79
+
80
+ OAuth login always requests read-write scope. For service accounts,
81
+ `get_credentials(profile, writable=...)` picks readonly vs read-write — the
82
+ `sitemaps submit`/`delete` commands request writable credentials.
83
+
84
+ ## Conventions
85
+
86
+ - Run everything through `uv run` (e.g. `uv run gsc ...`).
87
+ - `--format` is **global** and precedes the subcommand:
88
+ `gsc --format json query ...`, not `gsc query --format json ...`.
89
+ - Filters use the form `'dimension operator expression'`, e.g.
90
+ `--filter 'query contains running shoes'`. `--filter` is repeatable and the
91
+ filters are AND-combined.
92
+ - Site URLs are either `https://www.example.com/` (with trailing slash) or
93
+ `sc-domain:example.com`.
94
+ - Date convention for the analysis skills: **end date = today − 3 days** (GSC data
95
+ lags ~2–3 days).
96
+ - Python 3.11+, `from __future__ import annotations` in every module, full type
97
+ hints. Lint/format with `ruff` (line-length 100): `uv run ruff check .`.
gsc_cli-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SEO Consult
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
gsc_cli-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,173 @@
1
+ Metadata-Version: 2.5
2
+ Name: gsc-cli
3
+ Version: 0.2.0
4
+ Summary: Google Search Console CLI and backend for Claude Code SEO-analysis skills.
5
+ Project-URL: Homepage, https://seoconsult.bg
6
+ Project-URL: Documentation, https://github.com/seoconsultbg/gsc-cli#readme
7
+ Project-URL: Repository, https://github.com/seoconsultbg/gsc-cli
8
+ Project-URL: Issues, https://github.com/seoconsultbg/gsc-cli/issues
9
+ Author-email: SEO Consult <margpeeva@gmail.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: cli,google-search-console,gsc,search-analytics,search-console-api,seo,sitemaps,url-inspection,webmaster-tools
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Information Technology
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
23
+ Classifier: Topic :: Utilities
24
+ Requires-Python: >=3.11
25
+ Requires-Dist: click>=8.1
26
+ Requires-Dist: google-api-python-client>=2.0
27
+ Requires-Dist: google-auth-httplib2>=0.1
28
+ Requires-Dist: google-auth-oauthlib>=1.0
29
+ Requires-Dist: google-auth>=2.0
30
+ Requires-Dist: pyyaml>=6.0
31
+ Requires-Dist: tabulate>=0.9
32
+ Description-Content-Type: text/markdown
33
+
34
+ # gsc-cli
35
+
36
+ [![PyPI version](https://img.shields.io/pypi/v/gsc-cli.svg)](https://pypi.org/project/gsc-cli/)
37
+ [![Python versions](https://img.shields.io/pypi/pyversions/gsc-cli.svg)](https://pypi.org/project/gsc-cli/)
38
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
39
+ [![Ruff](https://img.shields.io/badge/lint-ruff-261230.svg)](https://github.com/astral-sh/ruff)
40
+
41
+ **A fast, scriptable Google Search Console CLI** - pull Search Analytics, inspect
42
+ URLs, and manage sitemaps straight from your terminal, with clean `--format json`
43
+ output that pipes into any tool. It also powers a set of Claude Code SEO-analysis
44
+ skills.
45
+
46
+ > Built and maintained by **[SEO Consult](https://seoconsult.bg)**, a Bulgarian
47
+ > [SEO агенция](https://seoconsult.bg) that lives in Search Console data.
48
+
49
+ ---
50
+
51
+ ## Why gsc-cli
52
+
53
+ - **Everything as JSON.** `--format json` on any command → feed rankings, CTR, and
54
+ impressions into scripts, notebooks, or LLM prompts without scraping the UI.
55
+ - **Search Analytics done right.** Query by `query`, `page`, `country`, `device`,
56
+ or `date`, with repeatable AND-combined `--filter` expressions.
57
+ - **URL Inspection & sitemaps.** Check index coverage for any URL and list/submit/
58
+ delete sitemaps.
59
+ - **Multi-profile auth.** OAuth2 *and* service accounts, with per-site
60
+ auto-detection - juggle many client properties from one config.
61
+ - **Table / CSV / JSON** output for humans and machines alike.
62
+ - **The data the API leaves out.** Google Lens / Circle to Search traffic
63
+ (Web: multimodal) and the Generative AI report (AI Overviews + AI Mode) exist
64
+ only as UI exports. `gsc multimodal` and `gsc genai` parse those exports and
65
+ join them with API numbers for the same dates.
66
+
67
+ ## Install
68
+
69
+ ```bash
70
+ pip install gsc-cli # from PyPI
71
+ # or, for local development:
72
+ uv sync # create venv + install + register the `gsc` binary
73
+ ```
74
+
75
+ ## Quick start
76
+
77
+ ```bash
78
+ export GSC_CLIENT_SECRETS=/path/to/client_secrets.json # from Google Cloud Console
79
+ gsc auth login # OAuth2 browser flow
80
+ gsc sites list # confirm access
81
+
82
+ # Top queries for the last 28 days, as JSON:
83
+ gsc --format json query https://www.example.com/ \
84
+ --start-date 2026-01-01 --end-date 2026-01-28 --dimensions query
85
+ ```
86
+
87
+ `--format` is **global** and precedes the subcommand
88
+ (`gsc --format json query ...`). Filters use `'dimension operator expression'`,
89
+ e.g. `--filter 'query contains running shoes'`.
90
+
91
+ ## Commands
92
+
93
+ | Command | What it does |
94
+ | --- | --- |
95
+ | `gsc auth` | `login`, `add-profile`, `list/remove-profile`, `status` |
96
+ | `gsc sites` | List and inspect verified properties |
97
+ | `gsc query` | Search Analytics (clicks, impressions, CTR, position) |
98
+ | `gsc inspect` | URL Inspection API - index/coverage verdict for a URL |
99
+ | `gsc sitemaps` | `list`, `get`, `submit`, `delete` |
100
+ | `gsc multimodal` | Parse a Web: multimodal export; `--compare` adds the camera share per page |
101
+ | `gsc genai` | Parse a Generative AI report export; `--compare` adds the AI lift index per page |
102
+
103
+ Run `gsc --help` or `gsc <command> --help` for the full flag reference.
104
+
105
+ ## AI Overviews and AI Mode by page
106
+
107
+ The Generative AI report in Search Console shows how often each page appeared
108
+ inside AI Overviews and AI Mode. The API does not return it, so export it from the
109
+ UI (Performance -> Generative AI -> Export -> Download CSV) and run:
110
+
111
+ ```bash
112
+ gsc genai https://www.example.com/ export.zip --compare --start-date 2026-06-22 --end-date 2026-09-21
113
+ ```
114
+
115
+ For every page you get its AI impressions next to its organic clicks, impressions
116
+ and average position, plus `ai_lift`: the page's share of AI impressions divided by
117
+ its share of organic impressions. Above 1, AI uses the page more than its organic
118
+ weight would suggest. Pages with fewer than 100 AI or 1,000 organic impressions are
119
+ marked `qualified: false`, because small numbers give silly ratios.
120
+
121
+ Add `--bands` to see how AI impressions split across position bands (1-3, 4-10,
122
+ 11-20, 21+). On the sites we have checked so far, most AI visibility sits on pages
123
+ ranking 4-10, not in the top 3. Informational pages score high lift. Stock, deals
124
+ and dealer-locator pages score close to zero, because Google rarely shows an AI
125
+ answer for those searches.
126
+
127
+ `--by date` gives the daily series. Put it next to `gsc query --dimensions date`:
128
+ if the AI-to-organic ratio suddenly collapses, check whether Googlebot can still
129
+ reach the site. On one site, a firewall block cut organic impressions by 42% and AI
130
+ impressions by 93%.
131
+
132
+ Some skill files mention companion skills (for example `ai-visibility-tracking`)
133
+ from a larger private setup. They are optional; the `gsc-*` skills work on their own.
134
+
135
+ ## Use with Claude Code
136
+
137
+ `gsc-cli` is the backend for a suite of Claude Code SEO skills (performance
138
+ overviews, cannibalization detection, quick-win opportunities, period compares,
139
+ indexing audits). The skills shell out to `gsc --format json` and reason over the
140
+ output. They ship as a Claude Code plugin in [`plugins/gsc-cli`](plugins/gsc-cli):
141
+
142
+ ```
143
+ /plugin marketplace add seoconsultbg/gsc-cli
144
+ /plugin install gsc-cli@seoconsult
145
+ ```
146
+
147
+ The plugin needs the `gsc` command on your PATH (`uv tool install gsc-cli` or
148
+ `pipx install gsc-cli`). See [CLAUDE.md](CLAUDE.md) for the architecture.
149
+
150
+ ## Configuration
151
+
152
+ Profiles live in `~/.config/gsc/config.yaml` (override with `GSC_CONFIG_DIR`).
153
+ A command resolves its profile by precedence: explicit `--profile`/`$GSC_PROFILE`
154
+ → the profile whose `sites` list contains the target URL → `default`. Full details
155
+ in [CLAUDE.md](CLAUDE.md).
156
+
157
+ ## Contributing
158
+
159
+ Issues and PRs welcome. Lint/format with `ruff` (line-length 100):
160
+
161
+ ```bash
162
+ uv run ruff check .
163
+ uv run pytest
164
+ ```
165
+
166
+ ## License
167
+
168
+ [MIT](LICENSE) - © 2026 [SEO Consult](https://seoconsult.bg).
169
+
170
+ ---
171
+
172
+ <sub>Maintained by the team at <a href="https://seoconsult.bg">SEO Consult</a>. If gsc-cli
173
+ saves you time, a ⭐ on GitHub helps others find it.</sub>
@@ -0,0 +1,140 @@
1
+ # gsc-cli
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/gsc-cli.svg)](https://pypi.org/project/gsc-cli/)
4
+ [![Python versions](https://img.shields.io/pypi/pyversions/gsc-cli.svg)](https://pypi.org/project/gsc-cli/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
+ [![Ruff](https://img.shields.io/badge/lint-ruff-261230.svg)](https://github.com/astral-sh/ruff)
7
+
8
+ **A fast, scriptable Google Search Console CLI** - pull Search Analytics, inspect
9
+ URLs, and manage sitemaps straight from your terminal, with clean `--format json`
10
+ output that pipes into any tool. It also powers a set of Claude Code SEO-analysis
11
+ skills.
12
+
13
+ > Built and maintained by **[SEO Consult](https://seoconsult.bg)**, a Bulgarian
14
+ > [SEO агенция](https://seoconsult.bg) that lives in Search Console data.
15
+
16
+ ---
17
+
18
+ ## Why gsc-cli
19
+
20
+ - **Everything as JSON.** `--format json` on any command → feed rankings, CTR, and
21
+ impressions into scripts, notebooks, or LLM prompts without scraping the UI.
22
+ - **Search Analytics done right.** Query by `query`, `page`, `country`, `device`,
23
+ or `date`, with repeatable AND-combined `--filter` expressions.
24
+ - **URL Inspection & sitemaps.** Check index coverage for any URL and list/submit/
25
+ delete sitemaps.
26
+ - **Multi-profile auth.** OAuth2 *and* service accounts, with per-site
27
+ auto-detection - juggle many client properties from one config.
28
+ - **Table / CSV / JSON** output for humans and machines alike.
29
+ - **The data the API leaves out.** Google Lens / Circle to Search traffic
30
+ (Web: multimodal) and the Generative AI report (AI Overviews + AI Mode) exist
31
+ only as UI exports. `gsc multimodal` and `gsc genai` parse those exports and
32
+ join them with API numbers for the same dates.
33
+
34
+ ## Install
35
+
36
+ ```bash
37
+ pip install gsc-cli # from PyPI
38
+ # or, for local development:
39
+ uv sync # create venv + install + register the `gsc` binary
40
+ ```
41
+
42
+ ## Quick start
43
+
44
+ ```bash
45
+ export GSC_CLIENT_SECRETS=/path/to/client_secrets.json # from Google Cloud Console
46
+ gsc auth login # OAuth2 browser flow
47
+ gsc sites list # confirm access
48
+
49
+ # Top queries for the last 28 days, as JSON:
50
+ gsc --format json query https://www.example.com/ \
51
+ --start-date 2026-01-01 --end-date 2026-01-28 --dimensions query
52
+ ```
53
+
54
+ `--format` is **global** and precedes the subcommand
55
+ (`gsc --format json query ...`). Filters use `'dimension operator expression'`,
56
+ e.g. `--filter 'query contains running shoes'`.
57
+
58
+ ## Commands
59
+
60
+ | Command | What it does |
61
+ | --- | --- |
62
+ | `gsc auth` | `login`, `add-profile`, `list/remove-profile`, `status` |
63
+ | `gsc sites` | List and inspect verified properties |
64
+ | `gsc query` | Search Analytics (clicks, impressions, CTR, position) |
65
+ | `gsc inspect` | URL Inspection API - index/coverage verdict for a URL |
66
+ | `gsc sitemaps` | `list`, `get`, `submit`, `delete` |
67
+ | `gsc multimodal` | Parse a Web: multimodal export; `--compare` adds the camera share per page |
68
+ | `gsc genai` | Parse a Generative AI report export; `--compare` adds the AI lift index per page |
69
+
70
+ Run `gsc --help` or `gsc <command> --help` for the full flag reference.
71
+
72
+ ## AI Overviews and AI Mode by page
73
+
74
+ The Generative AI report in Search Console shows how often each page appeared
75
+ inside AI Overviews and AI Mode. The API does not return it, so export it from the
76
+ UI (Performance -> Generative AI -> Export -> Download CSV) and run:
77
+
78
+ ```bash
79
+ gsc genai https://www.example.com/ export.zip --compare --start-date 2026-06-22 --end-date 2026-09-21
80
+ ```
81
+
82
+ For every page you get its AI impressions next to its organic clicks, impressions
83
+ and average position, plus `ai_lift`: the page's share of AI impressions divided by
84
+ its share of organic impressions. Above 1, AI uses the page more than its organic
85
+ weight would suggest. Pages with fewer than 100 AI or 1,000 organic impressions are
86
+ marked `qualified: false`, because small numbers give silly ratios.
87
+
88
+ Add `--bands` to see how AI impressions split across position bands (1-3, 4-10,
89
+ 11-20, 21+). On the sites we have checked so far, most AI visibility sits on pages
90
+ ranking 4-10, not in the top 3. Informational pages score high lift. Stock, deals
91
+ and dealer-locator pages score close to zero, because Google rarely shows an AI
92
+ answer for those searches.
93
+
94
+ `--by date` gives the daily series. Put it next to `gsc query --dimensions date`:
95
+ if the AI-to-organic ratio suddenly collapses, check whether Googlebot can still
96
+ reach the site. On one site, a firewall block cut organic impressions by 42% and AI
97
+ impressions by 93%.
98
+
99
+ Some skill files mention companion skills (for example `ai-visibility-tracking`)
100
+ from a larger private setup. They are optional; the `gsc-*` skills work on their own.
101
+
102
+ ## Use with Claude Code
103
+
104
+ `gsc-cli` is the backend for a suite of Claude Code SEO skills (performance
105
+ overviews, cannibalization detection, quick-win opportunities, period compares,
106
+ indexing audits). The skills shell out to `gsc --format json` and reason over the
107
+ output. They ship as a Claude Code plugin in [`plugins/gsc-cli`](plugins/gsc-cli):
108
+
109
+ ```
110
+ /plugin marketplace add seoconsultbg/gsc-cli
111
+ /plugin install gsc-cli@seoconsult
112
+ ```
113
+
114
+ The plugin needs the `gsc` command on your PATH (`uv tool install gsc-cli` or
115
+ `pipx install gsc-cli`). See [CLAUDE.md](CLAUDE.md) for the architecture.
116
+
117
+ ## Configuration
118
+
119
+ Profiles live in `~/.config/gsc/config.yaml` (override with `GSC_CONFIG_DIR`).
120
+ A command resolves its profile by precedence: explicit `--profile`/`$GSC_PROFILE`
121
+ → the profile whose `sites` list contains the target URL → `default`. Full details
122
+ in [CLAUDE.md](CLAUDE.md).
123
+
124
+ ## Contributing
125
+
126
+ Issues and PRs welcome. Lint/format with `ruff` (line-length 100):
127
+
128
+ ```bash
129
+ uv run ruff check .
130
+ uv run pytest
131
+ ```
132
+
133
+ ## License
134
+
135
+ [MIT](LICENSE) - © 2026 [SEO Consult](https://seoconsult.bg).
136
+
137
+ ---
138
+
139
+ <sub>Maintained by the team at <a href="https://seoconsult.bg">SEO Consult</a>. If gsc-cli
140
+ saves you time, a ⭐ on GitHub helps others find it.</sub>
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "gsc-cli",
3
+ "displayName": "GSC CLI",
4
+ "version": "0.2.0",
5
+ "description": "Google Search Console analysis skills for Claude Code: performance overviews, period compares, cannibalization, quick wins, indexing audits and AI Mode query residue. Runs the open-source gsc CLI on your machine.",
6
+ "author": {
7
+ "name": "SEO Consult",
8
+ "url": "https://seoconsult.bg"
9
+ },
10
+ "homepage": "https://github.com/seoconsultbg/gsc-cli#readme",
11
+ "repository": "https://github.com/seoconsultbg/gsc-cli",
12
+ "license": "MIT",
13
+ "keywords": [
14
+ "seo",
15
+ "google-search-console",
16
+ "search-analytics",
17
+ "url-inspection",
18
+ "sitemaps",
19
+ "cannibalization",
20
+ "ai-overviews"
21
+ ],
22
+ "documentationUrl": "https://github.com/seoconsultbg/gsc-cli#readme",
23
+ "supportUrl": "https://github.com/seoconsultbg/gsc-cli/issues"
24
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SEO Consult
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,85 @@
1
+ # GSC CLI for Claude Code
2
+
3
+ Eleven skills that let Claude Code answer Google Search Console questions from your
4
+ own data: how a site is doing, what changed between two periods, which pages compete
5
+ for the same query, where the quick wins are, and why a page is not indexed. Each
6
+ skill runs the open-source `gsc` command on your machine, reads its JSON output and
7
+ reasons over it.
8
+
9
+ This is an unofficial tool. It is not affiliated with or endorsed by Google.
10
+
11
+ ## Skills
12
+
13
+ | Skill | What it does |
14
+ | --- | --- |
15
+ | `gsc-analyze` | 28-day health check: totals, daily trend, top queries and pages, device split |
16
+ | `gsc-compare` | Two periods side by side: gainers, losers, new and lost queries and pages |
17
+ | `gsc-opportunities` | Striking-distance queries (positions 11-20), low-CTR page-1 queries, high-impression terms with few clicks |
18
+ | `gsc-cannibalization` | Queries where several of your pages compete for the same term |
19
+ | `gsc-audit` | Indexing audit of top pages plus sitemap health |
20
+ | `gsc-inspect` | URL Inspection for one page: verdict, coverage, crawl and index status, canonical |
21
+ | `gsc-ai-mode-detect` | Finds AI Mode and AI Overviews conversation residue in the query report and estimates the hidden share |
22
+ | `gsc-query` | Ad-hoc Search Analytics lookups by query, page, country, device or date |
23
+ | `gsc-sitemaps` | List, inspect, submit and delete sitemaps |
24
+ | `gsc-sites` | List the properties your account can see |
25
+ | `gsc-core` | Shared reference the other skills load: commands, flags, date convention, benchmarks |
26
+
27
+ Some skill files mention companion skills (for example `ai-visibility-tracking`) from
28
+ a larger private setup. They are optional; these skills work on their own.
29
+
30
+ ## Requirements
31
+
32
+ - **Claude Code.** The skills need a local shell to run `gsc`. In claude.ai chat and
33
+ Cowork they load, but there is no `gsc` to call there, so use them from Claude Code.
34
+ - **Python 3.11+ and the `gsc` command on your PATH:**
35
+
36
+ ```bash
37
+ uv tool install gsc-cli # or: pipx install gsc-cli
38
+ ```
39
+
40
+ - **An OAuth client for the Search Console API** (Google Cloud Console -> APIs &
41
+ Services -> Credentials -> Desktop app). Point `GSC_CLIENT_SECRETS` at the
42
+ downloaded `client_secrets.json`, then sign in once:
43
+
44
+ ```bash
45
+ gsc auth login
46
+ gsc sites list
47
+ ```
48
+
49
+ Service accounts and separate profiles for different clients are supported as well;
50
+ see the [main README](https://github.com/seoconsultbg/gsc-cli#readme).
51
+
52
+ ## Install
53
+
54
+ In Claude Code:
55
+
56
+ ```
57
+ /plugin marketplace add seoconsultbg/gsc-cli
58
+ /plugin install gsc-cli@seoconsult
59
+ ```
60
+
61
+ Then ask in plain words, for example "how is https://www.example.com/ doing in
62
+ search" or "find keyword cannibalization on sc-domain:example.com".
63
+
64
+ ## What runs and where your data goes
65
+
66
+ - The skills run one local program, `gsc`. They do not call any API themselves.
67
+ - `gsc` talks only to Google: the Search Console APIs on googleapis.com, and Google's
68
+ OAuth endpoints when you sign in. It uses your own credentials, which stay on your
69
+ machine in `~/.config/gsc/`.
70
+ - `gsc-opportunities` also fetches the pages it is about to comment on, using
71
+ Claude's WebFetch, so its title and heading advice matches what is on the page
72
+ today. Those are your own public pages.
73
+ - `gsc multimodal` and `gsc genai` read CSV or ZIP exports that you download from the
74
+ Search Console interface yourself.
75
+ - Nothing is sent to SEO Consult or any other third party, and there is no telemetry.
76
+ - Only two commands change anything in Search Console: `gsc sitemaps submit` and
77
+ `gsc sitemaps delete`. The `gsc-sitemaps` skill confirms with you before it runs
78
+ either one. `gsc auth login` asks Google for read-write Search Console access
79
+ because those two commands need it.
80
+
81
+ ## License
82
+
83
+ MIT. Built and maintained by [SEO Consult](https://seoconsult.bg), an SEO agency in
84
+ Bulgaria. Source code, issues and the full CLI reference:
85
+ [github.com/seoconsultbg/gsc-cli](https://github.com/seoconsultbg/gsc-cli).