analytics
Google Ads CLI for Shell Scripts
Use the Google Ads CLI for shell scripts with headless JSON commands, schema discovery, credentials, and permission controls.
38 functions 18 read 20 write oauth2 with developer token auth
Google Ads CLI for Shell Scripts
Call integration functions from shell scripts with stable JSON input and output.
Use shell scripts for small local automations that need one or more integration calls. The Google Ads CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Google Ads CLI for Shell Scripts
kosmokrator integrations:configure google_ads --set developer_token="$GOOGLE_ADS_DEVELOPER_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call google_ads.google_ads_diagnostics '{}' --json Discovery Before Execution
Agents and scripts can inspect Google Ads docs and schemas 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 Useful Google Ads CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
google_ads.google_ads_diagnostics | Read | none | Show safe configuration diagnostics. |
google_ads.google_ads_list_accessible_customers | Read | none | List Google Ads customers directly accessible to the OAuth user. |
google_ads.google_ads_list_customer_clients | Read | none | List managed client accounts under a manager or customer. |
google_ads.google_ads_search | Read | none | Run a paginated Google Ads Query Language search. |
google_ads.google_ads_search_stream | Read | none | Run a streaming GAQL report for larger result sets. |
google_ads.google_ads_campaign_report | Read | none | Run a normalized campaign performance report. |
google_ads.google_ads_ad_group_report | Read | none | Run a normalized ad group performance report. |
google_ads.google_ads_ad_report | Read | none | Run an ad and creative performance report. |
google_ads.google_ads_keyword_report | Read | none | Run a keyword performance report. |
google_ads.google_ads_search_term_report | Read | none | Analyze search terms and query performance. |
google_ads.google_ads_asset_report | Read | none | Report on assets and policy/performance labels. |
google_ads.google_ads_performance_max_report | Read | none | Report on Performance Max campaigns and asset groups. |
google_ads.google_ads_list_campaigns | Read | none | List campaigns with status, budget, channel, and optimization fields. |
google_ads.google_ads_create_campaign_budget | Write | none | Create a campaign budget with micros normalization. |
google_ads.google_ads_manage_campaign | Write | none | Create, update, pause, enable, or remove campaigns. |
google_ads.google_ads_manage_ad_group | Write | none | Create, update, pause, enable, or remove ad groups. |
google_ads.google_ads_manage_keyword | Write | none | Add, update, or remove keyword criteria. |
google_ads.google_ads_manage_ad | Write | none | Create or manage responsive search ads and ad statuses. |
google_ads.google_ads_manage_campaign_criteria | Write | none | Add or remove location, language, schedule, and negative criteria. |
google_ads.google_ads_upload_image_asset | Write | none | Create image assets from pre-encoded image metadata. |
google_ads.google_ads_link_asset | Write | none | Link an asset to a customer, campaign, ad group, or asset group. |
google_ads.google_ads_create_search_campaign | Write | none | Create a complete paused Search campaign with budget, ad group, keywords, targets, and RSA. |
google_ads.google_ads_create_performance_max_campaign | Write | none | Create a governed Performance Max campaign using mixed mutate operations. |
google_ads.google_ads_generate_keyword_ideas | Read | none | Generate keyword ideas and forecasts inputs. |
google_ads.google_ads_list_recommendations | Read | none | List optimization recommendations. |
google_ads.google_ads_apply_recommendations | Write | none | Apply selected recommendations with explicit confirmation. |
google_ads.google_ads_upload_click_conversions | Write | none | Upload offline or enhanced lead click conversions. |
google_ads.google_ads_upload_call_conversions | Write | none | Upload offline call conversions. |
google_ads.google_ads_create_customer_match_list | Write | none | Create a CRM-based user list for Customer Match. |
google_ads.google_ads_run_customer_match_job | Write | none | Create, populate, and run an OfflineUserDataJob for audience uploads. |
google_ads.google_ads_get_change_status | Read | none | List changed resources for sync workflows. |
google_ads.google_ads_get_change_events | Read | none | List field-level recent account changes. |
google_ads.google_ads_create_batch_job | Write | none | Create a batch job for large async operations. |
google_ads.google_ads_mutate | Write | none | Governed resource-specific or mixed mutate escape hatch. |
google_ads.google_ads_raw_request | Write | none | Low-level versioned Google Ads API request for advanced coverage. |
google_ads.google_ads_list_billing_setups | Read | none | List billing setup resources. |
google_ads.google_ads_account_budget_proposal | Write | none | Create account budget proposal operations for monthly invoicing accounts. |
google_ads.google_ads_invite_user | Write | none | Invite a user to a Google Ads account. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.