Introducing Ads CLI: A Command-Line Interface for Meta Ads and Commerce
Blog

Introducing Ads CLI: A Command-Line Interface for Meta Ads and Commerce

2026.05.25
·Web·by Homin.Lee
#Automation#CLI#Developer Tools#Marketing API#Meta Ads

Key Points

  • 1Meta has launched Ads CLI, a new command-line interface for developers and AI agents to manage Meta ad campaigns and commerce directly from the terminal.
  • 2The tool simplifies common tasks like creating, editing, and analyzing campaigns, ad sets, ads, creatives, product catalogs, and conversion datasets.
  • 3Designed for automation, Ads CLI streamlines programmatic ad management by abstracting repetitive API tasks and supporting various output formats for seamless integration into workflows.

The Meta ads CLI is a newly introduced command-line interface designed to streamline the management of Meta ad campaigns for developers and AI agents utilizing the Meta Marketing API. The core methodology of this tool is to abstract away repetitive programmatic tasks, such as authentication, pagination, output formatting, and error handling, which are typically required when interacting directly with the Meta Marketing API. By packaging these functionalities into a unified, predictable command-line utility, the ads CLI aims to accelerate development and facilitate integration into automated workflows.

Key features and capabilities provided by the Meta ads CLI include:

  1. Ad Creation and Management: The CLI enables direct command-line operations for creating, listing, updating, and deleting ad campaign components. This encompasses campaigns, ad sets, ads, and creatives. By default, resources are created in a PAUSED status, requiring explicit activation (e.g., metaadscampaignupdate<CAMPAIGNID>statusACTIVEmeta ads campaign update <CAMPAIGN_ID> --status ACTIVE). Specific commands like meta ads campaign create, meta ads adset create, meta ads creative create, and meta ads ad create support detailed parameter specification for attributes such as name, objective, daily-budget, optimization-goal, bid-amount, targeting-countries, image paths, and call-to-action types.
  1. Performance Insights: Users can query comprehensive performance metrics, including spend, impressions, Click-Through Rate (CTR), and Return on Ad Spend (ROAS). The tool supports flexible date ranges using options like --date-preset last_7d and allows for data breakdowns by demographics (age/gender) or platform. Aggregation levels can be specified, enabling detailed insights at the campaign level via commands like metaadsinsightsgetcampaignid<ID>fields=impressions,conversionsmeta ads insights get --campaign_id <ID> --fields=impressions,conversions.
  1. Catalog Creation and Management: The CLI provides functionalities to create and manage product catalogs, individual products within catalogs, and product sets. This includes meta ads catalog create for initiating a new catalog and meta ads product-item create for adding specific products with detailed attributes like --retailer-id, --name, --url, --price, --currency, and --image-url. Product sets can also be listed using meta ads product-set list.
  1. Datasets: The tool facilitates the creation of conversion pixels, their connection to ad accounts, and their linking to product catalogs to establish end-to-end conversion tracking. Examples include meta ads dataset create for pixel creation and metaadsdatasetconnect<PIXELID>adaccountid<ACCOUNTID>catalogid<CATALOGID>meta ads dataset connect <PIXEL_ID> --ad-account-id <ACCOUNT_ID> --catalog-id <CATALOG_ID> for establishing connections.

For automation and integration, the Meta ads CLI is designed to operate seamlessly in various environments, including CI/CD pipelines, interactive shell sessions, and custom scripts. It supports three distinct output formats: table for human readability, json for programmatic parsing (e.g., piping to jq), and plain (tab-separated values) for integration with standard Unix tools like sort, awk, and cut. To enhance automation, the CLI includes flags such as --no-input and --force to suppress interactive prompts. Error handling is standardized through conventional exit codes (e.g., 0 for success, 3 for authentication errors, 4 for API errors), enabling robust programmatic error detection. Sensitive information, such as API tokens and account IDs, can be managed securely through environment variables, preventing their exposure in command histories or version control systems. The tool requires Python 3.12+ and pip or uv for installation and operation.