KosmoKrator

analytics

Google Search Console CLI for AI Agents

Use the Google Search Console CLI from KosmoKrator to call Google Search Console tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

9 functions 5 read 4 write OAuth browser flow auth

Google Search Console CLI Setup

Google Search Console can be configured headlessly with `kosmokrator integrations:configure google_search_console`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure google_search_console --set access_token="$GOOGLE_SEARCH_CONSOLE_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor google_search_console --json
kosmokrator integrations:status --json

Credentials

Authentication type: OAuth browser flow oauth2_authorization_code. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token GOOGLE_SEARCH_CONSOLE_ACCESS_TOKEN OAuth token oauth yes Google Account

Call Google Search Console Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call google_search_console.google_search_console_add_site '{
  "site_url": "example_site_url"
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:google_search_console google_search_console_add_site '{
  "site_url": "example_site_url"
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs google_search_console --json
kosmo integrations:docs google_search_console.google_search_console_add_site --json
kosmo integrations:schema google_search_console.google_search_console_add_site --json
kosmo integrations:search "Google Search Console" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Google Search Console.

google_search_console.google_search_console_add_site

Write write

Add a new site property to Google Search Console.

Parameters
site_url

Generic CLI call

kosmo integrations:call google_search_console.google_search_console_add_site '{"site_url":"example_site_url"}' --json

Provider shortcut

kosmo integrations:google_search_console google_search_console_add_site '{"site_url":"example_site_url"}' --json

google_search_console.google_search_console_delete_site

Write write

Remove a site property from Google Search Console.

Parameters
site_url

Generic CLI call

kosmo integrations:call google_search_console.google_search_console_delete_site '{"site_url":"example_site_url"}' --json

Provider shortcut

kosmo integrations:google_search_console google_search_console_delete_site '{"site_url":"example_site_url"}' --json

google_search_console.google_search_console_delete_sitemap

Write write

Remove a sitemap from Google Search Console.

Parameters
site_url, sitemap_url

Generic CLI call

kosmo integrations:call google_search_console.google_search_console_delete_sitemap '{"site_url":"example_site_url","sitemap_url":"example_sitemap_url"}' --json

Provider shortcut

kosmo integrations:google_search_console google_search_console_delete_sitemap '{"site_url":"example_site_url","sitemap_url":"example_sitemap_url"}' --json

google_search_console.google_search_console_get_sitemap

Read read

Get details of a specific sitemap in Google Search Console. Returns the sitemap's path, last submitted/downloaded dates, whether it's a sitemap index, and content type breakdown with submitted vs indexed URL counts.

Parameters
site_url, sitemap_url

Generic CLI call

kosmo integrations:call google_search_console.google_search_console_get_sitemap '{"site_url":"example_site_url","sitemap_url":"example_sitemap_url"}' --json

Provider shortcut

kosmo integrations:google_search_console google_search_console_get_sitemap '{"site_url":"example_site_url","sitemap_url":"example_sitemap_url"}' --json

google_search_console.google_search_console_inspect_url

Read read

Check a URL's indexing status in Google Search Console. Returns: index verdict, coverage state, last crawl time, robots.txt state, indexing state, rich results, mobile usability, and AMP status.

Parameters
site_url, url

Generic CLI call

kosmo integrations:call google_search_console.google_search_console_inspect_url '{"site_url":"example_site_url","url":"example_url"}' --json

Provider shortcut

kosmo integrations:google_search_console google_search_console_inspect_url '{"site_url":"example_site_url","url":"example_url"}' --json

google_search_console.google_search_console_list_sitemaps

Read read

List all submitted sitemaps for a Google Search Console property. Returns each sitemap's path, last submitted/downloaded dates, whether it's a sitemap index, and content type counts (submitted vs indexed URLs).

Parameters
site_url

Generic CLI call

kosmo integrations:call google_search_console.google_search_console_list_sitemaps '{"site_url":"example_site_url"}' --json

Provider shortcut

kosmo integrations:google_search_console google_search_console_list_sitemaps '{"site_url":"example_site_url"}' --json

google_search_console.google_search_console_list_sites

Read read

List all verified Google Search Console sites/properties with their permission levels. Use this first to discover available properties before querying performance data or inspecting URLs. Returns each site's URL (e.g., "sc-domain:example.com" or "https://www.example.com/") and your permission level.

Parameters
none

Generic CLI call

kosmo integrations:call google_search_console.google_search_console_list_sites '{}' --json

Provider shortcut

kosmo integrations:google_search_console google_search_console_list_sites '{}' --json

google_search_console.google_search_console_performance

Read read

Query Google Search Console search performance data (clicks, impressions, CTR, position). Common queries: "top pages by clicks" → dimensions=["page"]. "Top search queries" → dimensions=["query"]. "Traffic trend" → dimensions=["date"]. "Mobile vs desktop" → dimensions=["device"]. "Blog section" → dimensions=["page"], filters=[{dimension:"page", operator:"contains", value:"/blog/"}]. Combine dimensions: dimensions=["query","device"] for queries by device.

Parameters
site_url, start_date, end_date, dimensions, filters, limit, offset, type, data_state, aggregation_type

Generic CLI call

kosmo integrations:call google_search_console.google_search_console_performance '{"site_url":"example_site_url","start_date":"example_start_date","end_date":"example_end_date","dimensions":"example_dimensions","filters":"example_filters","limit":1,"offset":1,"type":"example_type"}' --json

Provider shortcut

kosmo integrations:google_search_console google_search_console_performance '{"site_url":"example_site_url","start_date":"example_start_date","end_date":"example_end_date","dimensions":"example_dimensions","filters":"example_filters","limit":1,"offset":1,"type":"example_type"}' --json

google_search_console.google_search_console_submit_sitemap

Write write

Submit a new sitemap to Google Search Console.

Parameters
site_url, sitemap_url

Generic CLI call

kosmo integrations:call google_search_console.google_search_console_submit_sitemap '{"site_url":"example_site_url","sitemap_url":"example_sitemap_url"}' --json

Provider shortcut

kosmo integrations:google_search_console google_search_console_submit_sitemap '{"site_url":"example_site_url","sitemap_url":"example_sitemap_url"}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

google_search_console.google_search_console_add_site

Add a new site property to Google Search Console.

Operation
Write write
Schema command
kosmo integrations:schema google_search_console.google_search_console_add_site --json
ParameterTypeRequiredDescription
site_url string yes Site property URL (e.g., "https://example.com/" for URL-prefix or "sc-domain:example.com" for domain property).

google_search_console.google_search_console_delete_site

Remove a site property from Google Search Console.

Operation
Write write
Schema command
kosmo integrations:schema google_search_console.google_search_console_delete_site --json
ParameterTypeRequiredDescription
site_url string yes Site property URL to remove.

google_search_console.google_search_console_delete_sitemap

Remove a sitemap from Google Search Console.

Operation
Write write
Schema command
kosmo integrations:schema google_search_console.google_search_console_delete_sitemap --json
ParameterTypeRequiredDescription
site_url string yes Site property URL (e.g., "sc-domain:example.com" or "https://www.example.com/").
sitemap_url string yes Full sitemap URL to remove.

google_search_console.google_search_console_get_sitemap

Get details of a specific sitemap in Google Search Console. Returns the sitemap's path, last submitted/downloaded dates, whether it's a sitemap index, and content type breakdown with submitted vs indexed URL counts.

Operation
Read read
Schema command
kosmo integrations:schema google_search_console.google_search_console_get_sitemap --json
ParameterTypeRequiredDescription
site_url string yes Site property URL (e.g., "sc-domain:example.com" or "https://www.example.com/").
sitemap_url string yes Full URL of the sitemap (e.g., "https://www.example.com/sitemap.xml").

google_search_console.google_search_console_inspect_url

Check a URL's indexing status in Google Search Console. Returns: index verdict, coverage state, last crawl time, robots.txt state, indexing state, rich results, mobile usability, and AMP status.

Operation
Read read
Schema command
kosmo integrations:schema google_search_console.google_search_console_inspect_url --json
ParameterTypeRequiredDescription
site_url string yes Site property URL (e.g., "sc-domain:example.com" or "https://www.example.com/").
url string yes Full URL to inspect (e.g., "https://www.example.com/page").

google_search_console.google_search_console_list_sitemaps

List all submitted sitemaps for a Google Search Console property. Returns each sitemap's path, last submitted/downloaded dates, whether it's a sitemap index, and content type counts (submitted vs indexed URLs).

Operation
Read read
Schema command
kosmo integrations:schema google_search_console.google_search_console_list_sitemaps --json
ParameterTypeRequiredDescription
site_url string yes Site property URL (e.g., "sc-domain:example.com" or "https://www.example.com/").

google_search_console.google_search_console_list_sites

List all verified Google Search Console sites/properties with their permission levels. Use this first to discover available properties before querying performance data or inspecting URLs. Returns each site's URL (e.g., "sc-domain:example.com" or "https://www.example.com/") and your permission level.

Operation
Read read
Schema command
kosmo integrations:schema google_search_console.google_search_console_list_sites --json
ParameterTypeRequiredDescription
No parameters.

google_search_console.google_search_console_performance

Query Google Search Console search performance data (clicks, impressions, CTR, position). Common queries: "top pages by clicks" → dimensions=["page"]. "Top search queries" → dimensions=["query"]. "Traffic trend" → dimensions=["date"]. "Mobile vs desktop" → dimensions=["device"]. "Blog section" → dimensions=["page"], filters=[{dimension:"page", operator:"contains", value:"/blog/"}]. Combine dimensions: dimensions=["query","device"] for queries by device.

Operation
Read read
Schema command
kosmo integrations:schema google_search_console.google_search_console_performance --json
ParameterTypeRequiredDescription
site_url string yes Site property URL (e.g., "sc-domain:example.com" or "https://www.example.com/"). Use google_search_console_list_sites to find it.
start_date string no Start date (YYYY-MM-DD). Default: 30 days ago.
end_date string no End date (YYYY-MM-DD). Default: 3 days ago.
dimensions array no Dimensions to group by (array). Options: "query", "page", "country", "device", "date", "searchAppearance". Combine multiple.
filters array no Filters: array of {dimension, operator, value}. Operators: "contains", "equals", "notContains", "notEquals".
limit integer no Max rows (default 1000, max 25000).
offset integer no Pagination offset (default 0).
type string no Search type: "web" (default), "discover", "image", "video", "news", "googleNews".
data_state string no Data state: "final" (default, reliable) or "all" (includes fresh/unprocessed).
aggregation_type string no Aggregation: "auto" (default), "byPage", or "byProperty".

google_search_console.google_search_console_submit_sitemap

Submit a new sitemap to Google Search Console.

Operation
Write write
Schema command
kosmo integrations:schema google_search_console.google_search_console_submit_sitemap --json
ParameterTypeRequiredDescription
site_url string yes Site property URL (e.g., "sc-domain:example.com" or "https://www.example.com/").
sitemap_url string yes Full sitemap URL (e.g., "https://example.com/sitemap.xml").

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.