gsc-cli-automation
Skill0 starsChanged 5 months agoMITView on GitHub
Google Search Consoleをコマンドで操作したい時(サイトマップ送信・検索パフォーマンス取得・URLインデックス状態の検査)。サービスアカウントが弾かれる時のADC(ユーザー認証)フォールバック手順込み。
- Installs packages
In this repository99 other files it gives its agents.
- agents-tools-quoted-jsonSkill
- asc-api-app-store-submitSkill
- asd-ste100Skill
- automation-bool-selector-pitfallsSkill
- automation-stale-cooldown-flagSkill
- autonomous-build-verifySkill
- book-to-skillSkill
- ccusage-cli-cost-trackingSkill
- chrome-ext-mv3-programmatic-injectSkill
- chrome-ext-store-assetsSkill
- claude-headless-p-invocationSkill
- claude-plugin-context-auditSkill
- claude-session-log-to-kbSkill
- cloudflare-workers-do-deploySkill
- codebase-to-courseSkill
- codesign-keychain-prompt-fixSkill
- codex-cli-setupSkill
- codex-delegation-handoffSkill
- content-factory-grounding-dedupSkill
- conversation-log-append-patternSkill
- cron-to-launchd-macosSkill
- cross-automation-shared-resource-killSkill
- design-token-migration-rnSkill
- discord-bot-image-to-claudeSkill
- discord-gateway-resume-dedupSkill
- excel-filtered-url-http-auditSkill
- execution-budget-vs-capsSkill
- expo-free-local-ios-testflightSkill
- ga4-connect-projectsSkill
- gcal-oauth-desktop-setupSkill
- git-commit-helperSkill
- git-prepush-secret-remote-checkSkill
- hatena-blogsync-autopostSkill
- hook-latency-wrapSkill
- hook-log-append-patternSkill
- html-to-pdf-slide-deckSkill
- humanizerSkill
- human-review-gate-shellSkill
- implementation-model-routingSkill
- insights-to-claude-mdSkill
- ios-permission-key-security-matrixSkill
- ios-sim-store-screenshotsSkill
- launchd-exit78-exconfig-debugSkill
- llm-content-pipeline-quality-gateSkill
- local-ai-video-pipelineSkill
- local-flux-mflux-image-genSkill
- local-llm-slow-diagnosisSkill
- local-music-generationSkill
- lottie-skottie-authoring-pitfallsSkill
- machine-wide-api-ratelimit-latchSkill
- macos-hook-path-timeoutSkill
- md-to-docx-reportSkill
- memory-md-inject-bloat-auditSkill
- message-display-secrets-maskSkill
- metric-source-attributionSkill
- migrate-icloud-desktop-assetsSkill
- nextauth-local-e2e-sessionSkill
- nextjs-rsc-payload-slimSkill
- nothing-designSkill
- openclaw-ollama-setupSkill
- The first 60 shown.
The file
Files
GSC をCLIで操作(googleapis + ADC)
ツール実体: ~/gsc-automation/gsc.mjs()。新規セットアップ時の手順。
Procedure
- 前提:
gcloud(brew install --cask google-cloud-sdk)、node、googleapis。 - GCPプロジェクト作成+Search Console API有効化:
gcloud auth login # ブラウザ同意(ユーザー) PID="gsc-auto-$RANDOM$RANDOM" gcloud projects create "$PID" --name="GSC Automation" gcloud config set project "$PID" gcloud services enable searchconsole.googleapis.com - 認証はADC(ユーザー)が確実(本人が全プロパティ所有なら):
googleapis 側はgcloud auth application-default login \ --scopes=openid,https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/webmasters gcloud auth application-default set-quota-project "$PID"new google.auth.GoogleAuth({ scopes:['.../webmasters'] })(keyFile無し)でADCを自動使用。 - 動作確認:
node gsc.mjs sitesで所有プロパティが出れば成功。 node gsc.mjs sync(config.jsonの全sitemap送信)/report/inspectを利用。
Pitfalls
- サービスアカウント方式はGSCの「ユーザー追加」がSAメールを弾く事がある("メールアドレスが見つかりませんでした")。作りたて伝播遅延もあるが、本人所有ならADCユーザー認証の方が確実で各プロパティへのSA追加作業も不要。
- ADCは quota project 未設定だとAPIが quota エラー→
set-quota-project必須。 gcloud iam service-accounts keys createはSA作成直後だとNOT_FOUND(伝播待ち8秒で再試行)。- Indexing APIで一般ページのインデックス強制は禁止(求人/動画限定・スパム判定)。やれるのはsitemap送信+クロール待ち+URL検査(読み取り)。
- siteUrl はURLプレフィックス型なら末尾スラッシュ必須。
- GSC未登録プロパティはAPI操作不可("sufficient permission"エラー)→先にプロパティ追加+所有権確認(HTMLファイル方式が楽)。
- 秘密: SAキー/ADC credentialは絶対コミットしない。
~/.config/配下・chmod 600。
Verification
node gsc.mjs sites で siteOwner 表示。inspect <site> <page> で coverage=Submitted and indexed ならインデックス済確認。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

