mcpField
P
pp-google-business-profile

pp-google-business-profile

github.com/mvanhornマーケティング・グロース2.1k92 回インストール今日更新
リポジトリ

pp-google-business-profile について

pp-google-business-profile は、Google Business Profile のリソースを管理する運用担当者向けの CLI スキルです。API 操作にローカル SQLite アーカイブを組み合わせ、検索、グループ分析、鮮度確認、変更監視を行えます。

主な機能

  1. 01アカウントとロケーションの管理
  2. 02リソースのローカル SQLite 保存
  3. 03同期済みプロフィールデータの検索
  4. 04リソースのグループ分析
  5. 05ロケーション変更の監視

活用シーン

  1. 01テキストを手掛かりに保存済みロケーションを検索
  2. 02店舗コード別のロケーション数の集計
  3. 03運用判断前のアーカイブ鮮度の確認
  4. 04ロケーション関連の変更の監視

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/mvanhorn/printing-press-library --skill pp-google-business-profile

インストール後、Claude Code で/pp-google-business-profileを入力して読み込まれたか確認します。

詳細

Google Business Profile — Printing Press CLI

前提条件:CLI のインストール

このスキルは google-business-profile-pp-cli バイナリを使用します。**このスキルのコマンドを実行する前に、CLI がインストールされていることを必ず確認してください。**インストールされていない場合は、先にインストールしてください。

  1. Printing Press インストーラーを使ってインストールします。
    npx -y @mvanhorn/printing-press-library install google-business-profile --cli-only
    
  2. 確認します:google-business-profile-pp-cli --version
  3. $GOPATH/bin(または $HOME/go/bin)が $PATH に含まれていることを確認します。

npx によるインストールに失敗した場合(Node がない、オフラインなど)は、Go を直接インストールしてください(Go 1.26.6 以降が必要です)。

go install github.com/mvanhorn/printing-press-library/library/marketing/google-business-profile/cmd/google-business-profile-pp-cli@latest

インストール後に --version で「command not found」と表示される場合、インストール手順でバイナリが $PATH に追加されていません。確認が完了するまで、スキルのコマンドを実行しないでください。

Google Business Profile CLI を使って API リソースを管理し、すばやい検索、グループ化された分析、ロールアウトの検証に備えて、リソースをローカルにアーカイブします。この CLI は、エンドポイントを幅広く網羅することと同じくらい、繰り返しの読み取りアクセスと監査可能性が重要なオペレーターのワークフロー向けに設計されています。

独自の機能

これらの機能は、この API の他のツールでは利用できません。

ローカルでのオペレーターワークフロー
  • workflow archive — Google Business Profile のリソースをローカルの SQLite アーカイブに作成し、エージェントが質問のたびに API を再呼び出しせずに、アカウントやロケーションを調査できるようにします。

    同期済みのスナップショットを使ってエージェントが追加の質問に回答できるため、繰り返しの一覧取得によるクォータ消費や遅延を抑えられます。

    google-business-profile-pp-cli workflow archive --agent
    
  • workflow status — リソーステーブル全体のローカルアーカイブの鮮度と同期状態を表示し、オフラインでの回答が引き続き信頼できるかどうかをオペレーターが把握できるようにします。

    古いアーカイブをもとに、エージェントが古い運用上の推奨を行うのを防ぎます。

    google-business-profile-pp-cli workflow status --agent
    
  • search — ネイティブの API 検索手段がない場合や、ライブ認証が利用できない場合に、FTS5 を使ってローカルに同期された Business Profile データを検索します。

    API ごとにカスタムフィルターを作成しなくても、同期済みレコードをすばやく検索できます。

    google-business-profile-pp-cli search "Toronto" --data-source local --type locations --limit 20 --json
    
  • analytics — 同期済みデータをグループ化して分析し、リソース数を集計するとともに分布の傾向を把握できます。事前にスプレッドシートへエクスポートする必要はありません。

    ロケーションの一覧管理や QA 作業に使える、軽量なレポート機能を CLI で実現します。

    google-business-profile-pp-cli analytics --type locations --group-by storeCode --limit 25 --json
    
監視と検証
  • tail — API をポーリングして NDJSON 形式の変更イベントを出力し、オペレーターがロケーション関連のアクティビティをほぼリアルタイムで監視できるようにします。

    CLI を単発の API 呼び出しだけでなく、アクティブな監視にも活用できます。

    google-business-profile-pp-cli tail --resource locations --interval 30s --follow=false --agent
    

レシピ

アーカイブ後、ロケーションの手がかりを検索する
google-business-profile-pp-cli workflow archive --agent && google-business-profile-pp-cli search "Main Street" --data-source local --type locations --limit 10 --json

ローカルストアを更新した後、ロケーション名、市区町村名、その他のテキストを手がかりに、すぐに検索します。

ローカルフィールドごとにロケーション数を集計する
google-business-profile-pp-cli analytics --type locations --group-by storeCode --limit 25 --json

レコードを別のツールにエクスポートせずに、同期済みアーカイブからグループ化された件数をすばやく取得します。

コマンドリファレンス

accounts — アカウントを管理します

  • google-business-profile-pp-cli accounts accept — 指定した招待を承諾します。
  • google-business-profile-pp-cli accounts create — 指定した親の配下に、指定した名前と種類のアカウントを作成します。
  • google-business-profile-pp-cli accounts create-admins — 指定したユーザーを、指定したアカウントの管理者になるよう招待します。
  • google-business-profile-pp-cli accounts decline — 指定した招待を辞退します。
  • google-business-profile-pp-cli accounts delete — 指定したアカウントから、指定した管理者を削除します。
  • google-business-profile-pp-cli accounts get — 指定したアカウントを取得します。
  • google-business-profile-pp-cli accounts list — 認証済みユーザーのすべてのアカウントを一覧表示します。
  • google-business-profile-pp-cli accounts list-admins — 指定したアカウントの管理者を一覧表示します。
  • google-business-profile-pp-cli accounts list-invitations — 指定したアカウントの保留中の招待を一覧表示します。
  • google-business-profile-pp-cli accounts patch — 指定したアカウント管理者の管理者情報を更新します。

attributes — 属性を管理します

  • google-business-profile-pp-cli attributes — 指定されたメインカテゴリと国に該当するロケーションで利用可能な属性の一覧を返します。

business-profile-performance-locations — ビジネスプロフィールのパフォーマンスロケーションを管理します

  • google-business-profile-pp-cli business-profile-performance-locations fetch-multi-daily-metrics-time-series — 指定した日次指標に関連付けられた、指定期間内の各日の値を返します。
  • google-business-profile-pp-cli business-profile-performance-locations get-daily-metrics-time-series — 指定した日次指標に関連付けられた、指定期間内の各日の値を返します。
  • google-business-profile-pp-cli business-profile-performance-locations list — 検索またはマップでビジネスを見つけるために使用された検索キーワードを返します。

categories — カテゴリを管理します

  • google-business-profile-pp-cli categories batch-get — 指定された言語と GConcept ID に対応するビジネスカテゴリの一覧を返します。
  • google-business-profile-pp-cli categories list — ビジネスカテゴリの一覧を返します。検索ではカテゴリ名が一致しますが、カテゴリ ID は一致しません。

chains — チェーンを管理します

  • google-business-profile-pp-cli chains get — 指定されたチェーンを取得します。チェーンが存在しない場合は NOT_FOUND を返します。
  • google-business-profile-pp-cli chains search — チェーン名に基づいてチェーンを検索します。

google_locations — Google ロケーションを管理します

  • google-business-profile-pp-cli google-locations search — 指定されたリクエストに一致する可能性のあるすべてのロケーションを検索します。

locations — ロケーションを管理します

  • google-business-profile-pp-cli locations <name> — ユーザーが所有するアカウントから、同じユーザーが管理する別のアカウントにロケーションを移動します。

my-business-business-accounts — マイビジネスのビジネスアカウントを管理します

  • google-business-profile-pp-cli my-business-business-accounts create — ログイン中のユーザーが所有する新しいロケーションを作成します。
  • google-business-profile-pp-cli my-business-business-accounts list — 指定されたアカウントのロケーションを一覧表示します。

my-business-business-locations — マイビジネスのビジネスロケーションを管理します

  • google-business-profile-pp-cli my-business-business-locations delete — ロケーションを削除します。このロケーションを API で削除できず、`google.mybusiness. でそのようにマークされている場合。
  • google-business-profile-pp-cli my-business-business-locations get-google-updated — Google マップと検索に実際に表示されているロケーションの属性を取得します。
  • google-business-profile-pp-cli my-business-business-locations patch — 指定されたロケーションを更新します。

my-business-lodging-locations — マイビジネスの宿泊施設ロケーションを管理します

  • google-business-profile-pp-cli my-business-lodging-locations get-google-updated — 指定されたロケーションの Google によって更新された宿泊施設情報を返します。
  • google-business-profile-pp-cli my-business-lodging-locations get-lodging — 指定されたロケーションの宿泊施設情報を返します。
  • google-business-profile-pp-cli my-business-lodging-locations update-lodging — 指定されたロケーションの宿泊施設情報を更新します。

my-business-notifications-accounts — マイビジネスの通知アカウントを管理します

  • google-business-profile-pp-cli my-business-notifications-accounts get-notification-setting — アカウントの Pub/Sub 通知設定を返します。
  • google-business-profile-pp-cli my-business-notifications-accounts update-notification-setting — Pub/Sub 通知を送信するトピックを Google に通知するため、アカウントの Pub/Sub 通知設定を行います。

my-business-place-locations — マイビジネスの場所ロケーションを管理します

  • google-business-profile-pp-cli my-business-place-locations create — 指定されたロケーションに関連付けられたプレイス アクション リンクを作成し、それを返します。
  • google-business-profile-pp-cli my-business-place-locations delete — 指定されたロケーションからプレイス アクション リンクを削除します。
  • google-business-profile-pp-cli my-business-place-locations get — 指定されたプレイス アクション リンクを取得します。
  • google-business-profile-pp-cli my-business-place-locations list — 指定されたロケーションのプレイス アクション リンクを一覧表示します。
  • google-business-profile-pp-cli my-business-place-locations patch — 指定されたプレイス アクション リンクを更新し、それを返します。

my-business-q-locations — my business q locations を管理します

  • google-business-profile-pp-cli my-business-q-locations create — 指定されたロケーションに質問を追加します。
  • google-business-profile-pp-cli my-business-q-locations delete — 現在のユーザーが作成した特定の質問を削除します。
  • google-business-profile-pp-cli my-business-q-locations delete-answersdelete — 質問に対して現在のユーザーが作成した回答を削除します。
  • google-business-profile-pp-cli my-business-q-locations list — 指定されたロケーションの質問とその回答の一部をページネーション形式で一覧表示します。
  • google-business-profile-pp-cli my-business-q-locations list-answers — 指定された質問の回答をページネーション形式で一覧表示します。
  • google-business-profile-pp-cli my-business-q-locations patch — 現在のユーザーが作成した特定の質問を更新します。
  • google-business-profile-pp-cli my-business-q-locations upsert — 指定された質問に対してユーザーが作成した回答を作成するか、既存の回答を更新します。

my-business-verifications-locations — my business verifications locations を管理します

  • google-business-profile-pp-cli my-business-verifications-locations complete — PENDING 状態の確認を完了します。これは AUTO 以外の確認方法の場合にのみ必要です。
  • google-business-profile-pp-cli my-business-verifications-locations fetch-verification-options — 特定の言語で、あるロケーションに対して利用可能なすべての確認オプションを報告します。
  • google-business-profile-pp-cli my-business-verifications-locations get-voice-of-merchant-state — VoiceOfMerchant の状態を取得します。
  • google-business-profile-pp-cli my-business-verifications-locations list — ロケーションの確認を、作成日時順に一覧表示します。
  • google-business-profile-pp-cli my-business-verifications-locations verify — ロケーションの確認プロセスを開始します。

place_action_type_metadata — プレイス アクション タイプのメタデータを管理します

  • google-business-profile-pp-cli place-action-type-metadata — ロケーションまたは国で利用可能なプレイス アクション タイプのリストを返します。

verification_tokens — 確認トークンを管理します

  • google-business-profile-pp-cli verification-tokens — ロケーションを確認するために、指定されたロケーション データのトークンを生成します。
適切なコマンドの見つけ方

やりたいことはわかっているが、どのコマンドがそれを行うかわからない場合は、CLI に直接尋ねてください:

google-business-profile-pp-cli which "<capability in your own words>"

which は、自然言語による機能のクエリを、この CLI の厳選された機能インデックスから最も一致するコマンドに解決します。終了コード 0 は少なくとも 1 件の一致を意味し、終了コード 2 は確実な一致がないことを意味します。その場合は --help にフォールバックするか、より絞り込んだクエリを使用してください。

認証のセットアップ

google-business-profile-pp-cli login を使用して OAuth2 で認証すると、CLI が Google Business Profile API のアクセス トークンを発行および更新できるようになります。GOOGLE_BUSINESS_PROFILE_OAUTH2 環境変数は、有効期間の短いアクセス トークンをすでに持っていて、非対話的に実行する必要がある場合にのみ使用するフォールバックです。

google-business-profile-pp-cli doctor を実行して、セットアップを確認してください。

エージェントモード

任意のコマンドに --agent を追加します。次のオプションに展開されます:--json --compact --no-input --no-color --yes。

  • パイプ可能 — stdout に JSON、stderr にエラーを出力します

  • フィルター可能 — --select でフィールドを絞り込めます。ドット区切りのパスはネストされた構造をたどり、配列は各要素をたどります。出力が冗長な API でコンテキストを小さく保つために重要です:

    google-business-profile-pp-cli accounts list --agent --select id,name,status
    
  • プレビュー可能 — --dry-run で、リクエストを送信せずに内容を表示します

  • オフライン対応 — 同期/検索コマンドは、利用可能な場合にローカル SQLite ストアを使用できます

  • 非対話型 — プロンプトは表示されず、すべての入力はフラグで指定します

  • リトライを明示 — すでに存在する項目の作成を成功として扱う場合に限り --idempotent を、削除対象が見つからない場合に成功として扱う場合に限り --ignore-missing を使用します

レスポンスエンベロープ

ローカルストアまたは API から読み取るコマンドは、出力を出所情報のエンベロープで囲みます:

{
  "meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
  "results": <data>
}

データには .results を解析し、ライブデータかローカルデータかを確認するには .meta.source を参照してください。人間が読みやすい N results (live) の概要は、stdout がターミナルであり、かつ機械可読形式のフラグ(--json、--csv、--compact、--quiet、--plain、--select)が指定されていない場合に限り stderr に出力されます。パイプやエージェントでの利用、および形式を明示した実行では、stdout には純粋な JSON が出力されます。

エージェントからのフィードバック

この CLI で気になる点に気づいたら(あなた自身でも、エージェントでも)、記録してください:

google-business-profile-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
google-business-profile-pp-cli feedback --stdin < notes.txt
google-business-profile-pp-cli feedback list --json --limit 10

エントリは ~/.local/share/google-business-profile-pp-cli/feedback.jsonl にローカル保存されます。GOOGLE_BUSINESS_PROFILE_FEEDBACK_ENDPOINT が設定され、かつ --send が渡されるか GOOGLE_BUSINESS_PROFILE_FEEDBACK_AUTO_SEND=true が設定されていない限り、POST されることはありません。デフォルトの動作はローカル保存のみです。

バグ報告ではなく、意外に感じたことを書いてください。短く、具体的に、1 行で記録してください。積み重ねにつながるのは、そうした記録です。

出力の配信

すべてのコマンドで --deliver <sink> を指定できます。出力は stdout に加えて(または stdout の代わりに)指定したシンクに送られるため、エージェントはコマンド結果を手動でパイプせずに振り分けられます。次の 3 つのシンクをサポートしています:

シンク動作
stdoutデフォルト。stdout のみに書き込みます
file:<path>出力を <path> にアトミックに書き込みます(一時ファイルを作成してから名前を変更)
webhook:<url>出力本文を URL に POST します(--compact の場合は application/json または application/x-ndjson)

不明なスキームは、サポートされているスキームを示す構造化エラーとともに拒否されます。Webhook の失敗時はゼロ以外の終了コードを返し、URL と HTTP ステータスを stderr に記録します。

名前付きプロファイル

プロファイルとは、保存して呼び出しごとに再利用するフラグ値のセットです。スケジュールされたエージェントが、毎回同じ設定で同じコマンドを実行する場合に使用します。これは HeyGen の「Beacon」パターンです。

google-business-profile-pp-cli profile save briefing --json
google-business-profile-pp-cli --profile briefing accounts list
google-business-profile-pp-cli profile list --json
google-business-profile-pp-cli profile show briefing
google-business-profile-pp-cli profile delete briefing --yes

明示的に指定したフラグは、常にプロファイルの値より優先されます。プロファイルの値はデフォルトより優先されます。agent-context は、利用可能なプロファイルをすべて available_profiles に一覧表示するため、情報を調べるエージェントは実行時にそれらを検出できます。

終了コード

コード意味
0成功
2使用方法のエラー(引数が不正)
3リソースが見つかりません
4認証が必要です
5API エラー(上流の問題)
7レート制限中(待機してから再試行)
10設定エラー

引数の解析

$ARGUMENTS を解析します:

  1. 空、help、または --help → google-business-profile-pp-cli --help の出力を表示
  2. install で始まる → mcp で終わる場合は MCP のインストール、それ以外の場合は上記の前提条件を参照
  3. その他すべて → 直接使用(CLI コマンドとして --agent を付けて実行)

MCP サーバーのインストール

  1. MCP サーバーをインストールします:
    go install github.com/mvanhorn/printing-press-library/library/marketing/google-business-profile/cmd/google-business-profile-pp-mcp@latest
    
  2. Claude Code に登録します:
    claude mcp add google-business-profile-pp-mcp -- google-business-profile-pp-mcp
    
  3. 確認します:claude mcp list

直接使用

  1. インストールされているか確認します:which google-business-profile-pp-cli 見つからない場合は、インストールを提案します(このスキルの冒頭にある前提条件を参照)。
  2. ユーザーのクエリに最適なコマンドを、上記の独自機能とコマンドリファレンスから選びます。
  3. --agent フラグを付けて実行します:
    google-business-profile-pp-cli <command> [subcommand] [args] --agent
    
  4. 曖昧な場合は、サブコマンドのヘルプを確認します:google-business-profile-pp-cli <command> --help。

コメント