← 返回 Skills 市场
nmadeleidev

Google Search Console CLI

作者 Gregory Potemkin · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
540
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install google-search-console-cli
功能描述
Use this skill when working with this repository's `gsc` CLI, including Google Cloud OAuth client setup, CLI authentication, troubleshooting auth/config issu...
使用说明 (SKILL.md)

Google Search Console CLI Skill

Use this skill to operate and troubleshoot the gsc CLI in this repository.

When To Use

Use this skill when the task involves any of:

  • setting up OAuth credentials for Google Search Console
  • authenticating this CLI
  • listing properties, managing sitemaps, URL inspection, or Search Analytics queries
  • diagnosing auth/config/API connectivity issues

Prerequisites

  • Python environment with this project installed (gsc command available)
  • A Google account with access to at least one Search Console property
  • Search Console API enabled for the Google Cloud project used by OAuth

Install This CLI

Recommended (pipx, global gsc command):

python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install google-search-console-cli
gsc --version

From source (development):

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
gsc --help

From source (pipx, editable):

pipx install -e /absolute/path/to/google-search-console-cli
gsc --help

OAuth Client Setup In Google Cloud (Desktop App)

As of February 26, 2026, create OAuth client credentials in Google Cloud Console using these steps:

  1. Open Google Cloud Console and select/create a project.
  2. Enable the Search Console API for that project.
  3. Configure OAuth consent screen:
    • choose External for personal/testing usage (or Internal for Workspace org-only)
    • fill required app fields (app name, support email, developer contact)
    • add your Google account as a test user if app is in testing mode
  4. Go to APIs & Services -> Credentials.
  5. Click Create credentials -> OAuth client ID.
  6. Choose application type Desktop app.
  7. Create and download the OAuth client JSON (client_secret_*.json).

Notes:

  • UI labels can shift, but you must end with a Desktop OAuth client JSON file.
  • Keep the downloaded JSON private.

Authenticate This CLI

Preferred login flow:

gsc auth login --client-secret /absolute/path/to/client_secret.json

Useful auth options:

  • --readonly: request readonly scope only (webmasters.readonly)
  • --no-launch-browser: print the auth URL without auto-opening a browser

Verify credentials:

gsc auth whoami
gsc doctor

Default storage paths:

  • credentials: ~/.config/gsc-cli/credentials.json
  • app config: ~/.config/gsc-cli/config.json

Env overrides:

  • GSC_CREDENTIALS_FILE
  • GSC_APP_CONFIG_FILE
  • GSC_CONFIG_DIR

Optional: Set Default Property

gsc config set default-site sc-domain:example.com
gsc config get default-site

When set, commands that accept --site can omit it.

Command Reference

Top-level:

  • gsc --version
  • gsc --help
  • gsc doctor

auth

  • gsc auth login --client-secret FILE [--readonly] [--no-launch-browser]
  • gsc auth whoami [--output table|json]

config

  • gsc config set default-site SITE_URL
  • gsc config get default-site

site

  • gsc site list [--output table|json|csv] [--csv-path FILE]
  • gsc site get [--site SITE] [--output table|json|csv] [--csv-path FILE]
  • gsc site add [--site SITE]

SITE example: sc-domain:example.com.

sitemap

  • gsc sitemap list [--site SITE] [--sitemap-index TEXT] [--output table|json|csv] [--csv-path FILE]
  • gsc sitemap get [--site SITE] --feedpath TEXT [--output table|json|csv] [--csv-path FILE]
  • gsc sitemap submit [--site SITE] --feedpath TEXT
  • gsc sitemap delete [--site SITE] --feedpath TEXT

--feedpath alias: --path.

url

  • gsc url inspect [--site SITE] --url URL [--language-code CODE] [--output table|json|csv] [--csv-path FILE]

Defaults:

  • --language-code en-US

analytics

  • gsc analytics query --start-date YYYY-MM-DD --end-date YYYY-MM-DD [options]

Options:

  • --site SITE
  • --dimension country|date|device|hour|page|query|searchAppearance (repeatable)
  • --type discover|googleNews|image|news|video|web
  • --aggregation-type auto|byNewsShowcasePanel|byPage|byProperty
  • --row-limit 1..25000
  • --start-row >=0
  • --data-state all|final|hourly_all
  • --filter dimension:operator:expression (repeatable)
  • --output table|json|csv
  • --csv-path FILE

Supported filter dimensions:

  • country, device, page, query, searchAppearance

Supported filter operators:

  • contains, equals, notContains, notEquals, includingRegex, excludingRegex

Constraint:

  • --aggregation-type byProperty cannot be combined with page dimension or page filter.

Quick Examples

# List properties
gsc site list

# Get one property
gsc site get --site sc-domain:example.com

# List sitemaps
gsc sitemap list --site sc-domain:example.com

# Inspect one URL
gsc url inspect --site sc-domain:example.com --url https://example.com/page --output json

# Analytics query
gsc analytics query \
  --site sc-domain:example.com \
  --start-date 2026-01-01 \
  --end-date 2026-01-31 \
  --dimension date \
  --dimension query \
  --filter query:contains:brand

Troubleshooting

  • Auth error: Stored credentials do not include required scope ...

    • Re-run login with needed scope. For write commands, run login without --readonly.
  • No local OAuth credentials found...

    • Run: gsc auth login --client-secret \x3Cpath>
  • No site specified. Pass --site or set one...

    • pass --site or set default via gsc config set default-site ...
  • API failures / uncertain setup state

    • run gsc doctor first, then address failing checks.
安全使用建议
This skill appears to be a straightforward CLI guide for the local 'gsc' tool and Google OAuth setup. Before installing or following the instructions: 1) Confirm you intend to install the third-party pip package 'google-search-console-cli' from a source you trust (pipx pulls from PyPI by default). 2) Create and use OAuth credentials in a Google Cloud project you control, and keep the downloaded client_secret JSON private. 3) Prefer readonly scopes unless you need write actions. 4) Note the registry metadata omitted required binaries/envs — ensure you have Python, pipx or a virtualenv, and the 'gsc' command available. 5) Because the skill can be invoked by an agent, avoid supplying OAuth credentials to unknown agents; store secrets only in user-controlled locations (the default ~/.config/gsc-cli path or a path you set via env overrides).
功能分析
Type: OpenClaw Skill Name: google-search-console-cli Version: 1.0.0 The skill is classified as suspicious because it describes the use of a CLI (`gsc`) that handles sensitive OAuth client secrets and credentials, and provides capabilities to write data to arbitrary file paths via the `--csv-path FILE` option in multiple commands (e.g., `gsc site list`, `gsc analytics query`). While these are legitimate functions for a Google Search Console CLI, they introduce a significant risk of data overwrite or information disclosure if the agent is prompted to write to sensitive locations, or if the underlying CLI has path traversal vulnerabilities. The `SKILL.md` itself does not contain explicit malicious instructions or prompt injection attempts, but it exposes the agent to tools with high-risk capabilities.
能力评估
Purpose & Capability
The name/description match the instructions: the doc is a how-to for the gsc CLI and Google OAuth setup. Minor metadata mismatch: the skill metadata declares no required binaries or env vars, but the SKILL.md clearly expects a Python environment, the 'gsc' command, and optionally pipx/virtualenv. This is plausible (instruction-only skill) but the registry metadata is incomplete.
Instruction Scope
Instructions stay within the stated scope: installing/using the gsc CLI, creating a Google OAuth desktop client, running gsc auth/login, and troubleshooting. The doc references only local config paths (~/.config/gsc-cli) and the Google Cloud Console; it does not instruct reading unrelated system files or exfiltrating secrets to third parties.
Install Mechanism
This is an instruction-only skill (no install spec). Install recommendations use pipx or pip from source — common for Python CLIs. No arbitrary download URLs or archive extraction are suggested within the skill text.
Credentials
The skill uses OAuth client JSON and stores credentials locally; it notes env overrides (GSC_CREDENTIALS_FILE, GSC_APP_CONFIG_FILE, GSC_CONFIG_DIR) which are appropriate for configuring a CLI. The skill does not request unrelated cloud credentials or wide-ranging environment secrets in its metadata.
Persistence & Privilege
Skill is not always-enabled and is user-invocable; it does not request elevated or persistent platform privileges. It documents that the CLI writes credential/config files under the user's config directory, which is expected behavior for a CLI that caches OAuth tokens.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install google-search-console-cli
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /google-search-console-cli 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of the Google Search Console CLI skill. - Provides comprehensive instructions for installing, configuring, and authenticating the `gsc` CLI. - Includes detailed steps for Google Cloud OAuth client setup and recommended authentication workflow. - Documents all primary CLI commands (site management, sitemap management, URL inspection, analytics queries). - Offers troubleshooting guidance for common authentication and configuration issues. - Lists prerequisites and usage scenarios to guide users when to apply this skill.
元数据
Slug google-search-console-cli
版本 1.0.0
许可证
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Google Search Console CLI 是什么?

Use this skill when working with this repository's `gsc` CLI, including Google Cloud OAuth client setup, CLI authentication, troubleshooting auth/config issu... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 540 次。

如何安装 Google Search Console CLI?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install google-search-console-cli」即可一键安装,无需额外配置。

Google Search Console CLI 是免费的吗?

是的,Google Search Console CLI 完全免费(开源免费),可自由下载、安装和使用。

Google Search Console CLI 支持哪些平台?

Google Search Console CLI 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Google Search Console CLI?

由 Gregory Potemkin(@nmadeleidev)开发并维护,当前版本 v1.0.0。

💬 留言讨论