KosmoKrator

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, configure, and verify
# 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.

NameTypeDescription
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.

KeyEnv varTypeRequiredLabel
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.

Generic CLI call
kosmo integrations:call google-ads.google_ads_diagnostics '{}' --json
Provider shortcut
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.

Discovery commands
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 read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_diagnostics '{}' --json
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_list_accessible_customers '{}' --json
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_list_customer_clients '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_list_customer_clients '{}' --json

google-ads.google_ads_search

Run a paginated Google Ads Query Language search.

Read read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_search '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_search '{}' --json

google-ads.google_ads_search_stream

Run a streaming GAQL report for larger result sets.

Read read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_search_stream '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_search_stream '{}' --json

google-ads.google_ads_campaign_report

Run a normalized campaign performance report.

Read read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_campaign_report '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_campaign_report '{}' --json

google-ads.google_ads_ad_group_report

Run a normalized ad group performance report.

Read read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_ad_group_report '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_ad_group_report '{}' --json

google-ads.google_ads_ad_report

Run an ad and creative performance report.

Read read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_ad_report '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_ad_report '{}' --json

google-ads.google_ads_keyword_report

Run a keyword performance report.

Read read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_keyword_report '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_keyword_report '{}' --json

google-ads.google_ads_search_term_report

Analyze search terms and query performance.

Read read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_search_term_report '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_search_term_report '{}' --json

google-ads.google_ads_asset_report

Report on assets and policy/performance labels.

Read read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_asset_report '{}' --json
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_performance_max_report '{}' --json
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_list_campaigns '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_list_campaigns '{}' --json

google-ads.google_ads_create_campaign_budget

Create a campaign budget with micros normalization.

Write write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_create_campaign_budget '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_create_campaign_budget '{}' --json

google-ads.google_ads_manage_campaign

Create, update, pause, enable, or remove campaigns.

Write write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_manage_campaign '{}' --json
Shortcut
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 write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_manage_ad_group '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_manage_ad_group '{}' --json

google-ads.google_ads_manage_keyword

Add, update, or remove keyword criteria.

Write write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_manage_keyword '{}' --json
Shortcut
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 write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_manage_ad '{}' --json
Shortcut
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 write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_manage_campaign_criteria '{}' --json
Shortcut
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 write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_upload_image_asset '{}' --json
Shortcut
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 write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_link_asset '{}' --json
Shortcut
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 write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_create_search_campaign '{}' --json
Shortcut
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 write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_create_performance_max_campaign '{}' --json
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_generate_keyword_ideas '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_generate_keyword_ideas '{}' --json

google-ads.google_ads_list_recommendations

List optimization recommendations.

Read read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_list_recommendations '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_list_recommendations '{}' --json

google-ads.google_ads_apply_recommendations

Apply selected recommendations with explicit confirmation.

Write write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_apply_recommendations '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_apply_recommendations '{}' --json

google-ads.google_ads_upload_click_conversions

Upload offline or enhanced lead click conversions.

Write write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_upload_click_conversions '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_upload_click_conversions '{}' --json

google-ads.google_ads_upload_call_conversions

Upload offline call conversions.

Write write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_upload_call_conversions '{}' --json
Shortcut
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 write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_create_customer_match_list '{}' --json
Shortcut
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 write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_run_customer_match_job '{}' --json
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_get_change_status '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_get_change_status '{}' --json

google-ads.google_ads_get_change_events

List field-level recent account changes.

Read read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_get_change_events '{}' --json
Shortcut
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 write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_create_batch_job '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_create_batch_job '{}' --json

google-ads.google_ads_mutate

Governed resource-specific or mixed mutate escape hatch.

Write write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_mutate '{}' --json
Shortcut
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 write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_raw_request '{}' --json
Shortcut
kosmo integrations:google-ads google_ads_raw_request '{}' --json

google-ads.google_ads_list_billing_setups

List billing setup resources.

Read read
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_list_billing_setups '{}' --json
Shortcut
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 write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_account_budget_proposal '{}' --json
Shortcut
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 write
Parameters
none
Generic call
kosmo integrations:call google-ads.google_ads_invite_user '{}' --json
Shortcut
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
Schema command
kosmo integrations:schema google-ads.google_ads_diagnostics --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_list_accessible_customers 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_list_accessible_customers --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_list_customer_clients 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_list_customer_clients --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_search_stream 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_search_stream --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_campaign_report 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_campaign_report --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_ad_group_report 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_ad_group_report --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_ad_report 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_ad_report --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_keyword_report 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_keyword_report --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_search_term_report 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_search_term_report --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_asset_report 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_asset_report --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_performance_max_report 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_performance_max_report --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_list_campaigns 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_list_campaigns --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_create_campaign_budget 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_create_campaign_budget --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_manage_campaign 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_manage_campaign --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_manage_ad_group 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_manage_ad_group --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_manage_keyword 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_manage_keyword --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_manage_ad 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_manage_ad --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_manage_campaign_criteria 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_manage_campaign_criteria --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_upload_image_asset 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_upload_image_asset --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_create_search_campaign 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_create_search_campaign --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_create_performance_max_campaign 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_create_performance_max_campaign --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_generate_keyword_ideas 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_generate_keyword_ideas --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_list_recommendations 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_list_recommendations --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_apply_recommendations 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_apply_recommendations --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_upload_click_conversions 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_upload_click_conversions --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_upload_call_conversions 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_upload_call_conversions --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_create_customer_match_list 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_create_customer_match_list --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_run_customer_match_job 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_run_customer_match_job --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_get_change_status 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_get_change_status --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_get_change_events 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_get_change_events --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_create_batch_job 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_create_batch_job --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_mutate 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_mutate --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_raw_request 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_raw_request --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_list_billing_setups 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_list_billing_setups --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_account_budget_proposal 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_account_budget_proposal --json
ParameterTypeRequiredDescription
No parameters.
google-ads.google_ads_invite_user 0 parameters
Schema command
kosmo integrations:schema google-ads.google_ads_invite_user --json
ParameterTypeRequiredDescription
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.