analytics
Google Ads CLI for AI Agents
Use the Google Ads CLI from KosmoKrator to call Google Ads tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Google Ads CLI Setup
Google Ads can be configured headlessly with `kosmokrator integrations:configure google-ads`.
# 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-ads --set developer_token="$GOOGLE_ADS_DEVELOPER_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor google-ads --json
kosmokrator integrations:status --json Runtime Requirements
Install these host dependencies before calling Google Ads locally.
| Name | Type | Description |
|---|---|---|
runtime | dependency | |
runtime | dependency | |
runtime | dependency |
Credentials
Authentication type: oauth2 with developer token oauth2_with_developer_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
developer_token | GOOGLE_ADS_DEVELOPER_TOKEN | Secret secret | yes | Developer Token |
access_token | GOOGLE_ADS_ACCESS_TOKEN | Secret secret | no | Access Token |
refresh_token | GOOGLE_ADS_REFRESH_TOKEN | Secret secret | no | Refresh Token |
client_id | GOOGLE_ADS_CLIENT_ID | Text string | no | OAuth Client ID |
client_secret | GOOGLE_ADS_CLIENT_SECRET | Secret secret | no | OAuth Client Secret |
manager_customer_id | GOOGLE_ADS_MANAGER_CUSTOMER_ID | Text string | no | Manager Customer ID |
default_customer_id | GOOGLE_ADS_DEFAULT_CUSTOMER_ID | Text string | no | Default Customer ID |
api_version | GOOGLE_ADS_API_VERSION | Text string | no | API Version |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call google-ads.google_ads_diagnostics '{}' --json kosmo integrations:google-ads google_ads_diagnostics '{}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs google-ads --json
kosmo integrations:docs google-ads.google_ads_diagnostics --json
kosmo integrations:schema google-ads.google_ads_diagnostics --json
kosmo integrations:search "Google Ads" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
google-ads.google_ads_diagnostics
Show safe configuration diagnostics.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_diagnostics '{}' --json kosmo integrations:google-ads google_ads_diagnostics '{}' --json google-ads.google_ads_list_accessible_customers
List Google Ads customers directly accessible to the OAuth user.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_list_accessible_customers '{}' --json kosmo integrations:google-ads google_ads_list_accessible_customers '{}' --json google-ads.google_ads_list_customer_clients
List managed client accounts under a manager or customer.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_list_customer_clients '{}' --json kosmo integrations:google-ads google_ads_list_customer_clients '{}' --json google-ads.google_ads_search
Run a paginated Google Ads Query Language search.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_search '{}' --json kosmo integrations:google-ads google_ads_search '{}' --json google-ads.google_ads_search_stream
Run a streaming GAQL report for larger result sets.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_search_stream '{}' --json kosmo integrations:google-ads google_ads_search_stream '{}' --json google-ads.google_ads_campaign_report
Run a normalized campaign performance report.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_campaign_report '{}' --json kosmo integrations:google-ads google_ads_campaign_report '{}' --json google-ads.google_ads_ad_group_report
Run a normalized ad group performance report.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_ad_group_report '{}' --json kosmo integrations:google-ads google_ads_ad_group_report '{}' --json google-ads.google_ads_ad_report
Run an ad and creative performance report.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_ad_report '{}' --json kosmo integrations:google-ads google_ads_ad_report '{}' --json google-ads.google_ads_keyword_report
Run a keyword performance report.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_keyword_report '{}' --json kosmo integrations:google-ads google_ads_keyword_report '{}' --json google-ads.google_ads_search_term_report
Analyze search terms and query performance.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_search_term_report '{}' --json kosmo integrations:google-ads google_ads_search_term_report '{}' --json google-ads.google_ads_asset_report
Report on assets and policy/performance labels.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_asset_report '{}' --json kosmo integrations:google-ads google_ads_asset_report '{}' --json google-ads.google_ads_performance_max_report
Report on Performance Max campaigns and asset groups.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_performance_max_report '{}' --json kosmo integrations:google-ads google_ads_performance_max_report '{}' --json google-ads.google_ads_list_campaigns
List campaigns with status, budget, channel, and optimization fields.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_list_campaigns '{}' --json kosmo integrations:google-ads google_ads_list_campaigns '{}' --json google-ads.google_ads_create_campaign_budget
Create a campaign budget with micros normalization.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_create_campaign_budget '{}' --json kosmo integrations:google-ads google_ads_create_campaign_budget '{}' --json google-ads.google_ads_manage_campaign
Create, update, pause, enable, or remove campaigns.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_manage_campaign '{}' --json kosmo integrations:google-ads google_ads_manage_campaign '{}' --json google-ads.google_ads_manage_ad_group
Create, update, pause, enable, or remove ad groups.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_manage_ad_group '{}' --json kosmo integrations:google-ads google_ads_manage_ad_group '{}' --json google-ads.google_ads_manage_keyword
Add, update, or remove keyword criteria.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_manage_keyword '{}' --json kosmo integrations:google-ads google_ads_manage_keyword '{}' --json google-ads.google_ads_manage_ad
Create or manage responsive search ads and ad statuses.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_manage_ad '{}' --json kosmo integrations:google-ads google_ads_manage_ad '{}' --json google-ads.google_ads_manage_campaign_criteria
Add or remove location, language, schedule, and negative criteria.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_manage_campaign_criteria '{}' --json kosmo integrations:google-ads google_ads_manage_campaign_criteria '{}' --json google-ads.google_ads_upload_image_asset
Create image assets from pre-encoded image metadata.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_upload_image_asset '{}' --json kosmo integrations:google-ads google_ads_upload_image_asset '{}' --json google-ads.google_ads_link_asset
Link an asset to a customer, campaign, ad group, or asset group.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_link_asset '{}' --json kosmo integrations:google-ads google_ads_link_asset '{}' --json google-ads.google_ads_create_search_campaign
Create a complete paused Search campaign with budget, ad group, keywords, targets, and RSA.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_create_search_campaign '{}' --json kosmo integrations:google-ads google_ads_create_search_campaign '{}' --json google-ads.google_ads_create_performance_max_campaign
Create a governed Performance Max campaign using mixed mutate operations.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_create_performance_max_campaign '{}' --json kosmo integrations:google-ads google_ads_create_performance_max_campaign '{}' --json google-ads.google_ads_generate_keyword_ideas
Generate keyword ideas and forecasts inputs.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_generate_keyword_ideas '{}' --json kosmo integrations:google-ads google_ads_generate_keyword_ideas '{}' --json google-ads.google_ads_list_recommendations
List optimization recommendations.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_list_recommendations '{}' --json kosmo integrations:google-ads google_ads_list_recommendations '{}' --json google-ads.google_ads_apply_recommendations
Apply selected recommendations with explicit confirmation.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_apply_recommendations '{}' --json kosmo integrations:google-ads google_ads_apply_recommendations '{}' --json google-ads.google_ads_upload_click_conversions
Upload offline or enhanced lead click conversions.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_upload_click_conversions '{}' --json kosmo integrations:google-ads google_ads_upload_click_conversions '{}' --json google-ads.google_ads_upload_call_conversions
Upload offline call conversions.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_upload_call_conversions '{}' --json kosmo integrations:google-ads google_ads_upload_call_conversions '{}' --json google-ads.google_ads_create_customer_match_list
Create a CRM-based user list for Customer Match.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_create_customer_match_list '{}' --json kosmo integrations:google-ads google_ads_create_customer_match_list '{}' --json google-ads.google_ads_run_customer_match_job
Create, populate, and run an OfflineUserDataJob for audience uploads.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_run_customer_match_job '{}' --json kosmo integrations:google-ads google_ads_run_customer_match_job '{}' --json google-ads.google_ads_get_change_status
List changed resources for sync workflows.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_get_change_status '{}' --json kosmo integrations:google-ads google_ads_get_change_status '{}' --json google-ads.google_ads_get_change_events
List field-level recent account changes.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_get_change_events '{}' --json kosmo integrations:google-ads google_ads_get_change_events '{}' --json google-ads.google_ads_create_batch_job
Create a batch job for large async operations.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_create_batch_job '{}' --json kosmo integrations:google-ads google_ads_create_batch_job '{}' --json google-ads.google_ads_mutate
Governed resource-specific or mixed mutate escape hatch.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_mutate '{}' --json kosmo integrations:google-ads google_ads_mutate '{}' --json google-ads.google_ads_raw_request
Low-level versioned Google Ads API request for advanced coverage.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_raw_request '{}' --json kosmo integrations:google-ads google_ads_raw_request '{}' --json google-ads.google_ads_list_billing_setups
List billing setup resources.
read - Parameters
- none
kosmo integrations:call google-ads.google_ads_list_billing_setups '{}' --json kosmo integrations:google-ads google_ads_list_billing_setups '{}' --json google-ads.google_ads_account_budget_proposal
Create account budget proposal operations for monthly invoicing accounts.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_account_budget_proposal '{}' --json kosmo integrations:google-ads google_ads_account_budget_proposal '{}' --json google-ads.google_ads_invite_user
Invite a user to a Google Ads account.
write - Parameters
- none
kosmo integrations:call google-ads.google_ads_invite_user '{}' --json kosmo integrations:google-ads google_ads_invite_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
google-ads.google_ads_diagnostics 0 parameters
kosmo integrations:schema google-ads.google_ads_diagnostics --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_list_accessible_customers 0 parameters
kosmo integrations:schema google-ads.google_ads_list_accessible_customers --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_list_customer_clients 0 parameters
kosmo integrations:schema google-ads.google_ads_list_customer_clients --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_search 0 parameters
kosmo integrations:schema google-ads.google_ads_search --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_search_stream 0 parameters
kosmo integrations:schema google-ads.google_ads_search_stream --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_campaign_report 0 parameters
kosmo integrations:schema google-ads.google_ads_campaign_report --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_ad_group_report 0 parameters
kosmo integrations:schema google-ads.google_ads_ad_group_report --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_ad_report 0 parameters
kosmo integrations:schema google-ads.google_ads_ad_report --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_keyword_report 0 parameters
kosmo integrations:schema google-ads.google_ads_keyword_report --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_search_term_report 0 parameters
kosmo integrations:schema google-ads.google_ads_search_term_report --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_asset_report 0 parameters
kosmo integrations:schema google-ads.google_ads_asset_report --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_performance_max_report 0 parameters
kosmo integrations:schema google-ads.google_ads_performance_max_report --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_list_campaigns 0 parameters
kosmo integrations:schema google-ads.google_ads_list_campaigns --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_create_campaign_budget 0 parameters
kosmo integrations:schema google-ads.google_ads_create_campaign_budget --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_manage_campaign 0 parameters
kosmo integrations:schema google-ads.google_ads_manage_campaign --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_manage_ad_group 0 parameters
kosmo integrations:schema google-ads.google_ads_manage_ad_group --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_manage_keyword 0 parameters
kosmo integrations:schema google-ads.google_ads_manage_keyword --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_manage_ad 0 parameters
kosmo integrations:schema google-ads.google_ads_manage_ad --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_manage_campaign_criteria 0 parameters
kosmo integrations:schema google-ads.google_ads_manage_campaign_criteria --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_upload_image_asset 0 parameters
kosmo integrations:schema google-ads.google_ads_upload_image_asset --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_link_asset 0 parameters
kosmo integrations:schema google-ads.google_ads_link_asset --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_create_search_campaign 0 parameters
kosmo integrations:schema google-ads.google_ads_create_search_campaign --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_create_performance_max_campaign 0 parameters
kosmo integrations:schema google-ads.google_ads_create_performance_max_campaign --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_generate_keyword_ideas 0 parameters
kosmo integrations:schema google-ads.google_ads_generate_keyword_ideas --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_list_recommendations 0 parameters
kosmo integrations:schema google-ads.google_ads_list_recommendations --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_apply_recommendations 0 parameters
kosmo integrations:schema google-ads.google_ads_apply_recommendations --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_upload_click_conversions 0 parameters
kosmo integrations:schema google-ads.google_ads_upload_click_conversions --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_upload_call_conversions 0 parameters
kosmo integrations:schema google-ads.google_ads_upload_call_conversions --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_create_customer_match_list 0 parameters
kosmo integrations:schema google-ads.google_ads_create_customer_match_list --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_run_customer_match_job 0 parameters
kosmo integrations:schema google-ads.google_ads_run_customer_match_job --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_get_change_status 0 parameters
kosmo integrations:schema google-ads.google_ads_get_change_status --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_get_change_events 0 parameters
kosmo integrations:schema google-ads.google_ads_get_change_events --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_create_batch_job 0 parameters
kosmo integrations:schema google-ads.google_ads_create_batch_job --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_mutate 0 parameters
kosmo integrations:schema google-ads.google_ads_mutate --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_raw_request 0 parameters
kosmo integrations:schema google-ads.google_ads_raw_request --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_list_billing_setups 0 parameters
kosmo integrations:schema google-ads.google_ads_list_billing_setups --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_account_budget_proposal 0 parameters
kosmo integrations:schema google-ads.google_ads_account_budget_proposal --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
google-ads.google_ads_invite_user 0 parameters
kosmo integrations:schema google-ads.google_ads_invite_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
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.