Manage Meta ad campaigns from your terminal.
meta-ads-cli is an early independent open source command-line tool for the Meta Ads API, published before Meta later introduced its official Ads AI Connectors. Use it when you want a lightweight, self-managed CLI you can inspect, fork, and run inside your own workflow.
View on GitHubEarly independent. Now part of a bigger category.
Attainment published this open source CLI in February 2026. Meta later introduced official Ads AI Connectors, including its own Ads CLI and hosted ads MCP endpoint.
Use Meta's official path when
You want Meta-hosted OAuth, first-party support, and the official connector experience.
View Meta Ads CLI docsUse this project when
You want a lightweight, forkable, self-managed CLI with review-first defaults and no hosted control plane.
Read the playbookSame API. No browser required.
Everything you do in Meta Business Manager, done from the command line. Script it, automate it, integrate it into your existing workflows.
0
browser tabs needed
5
commands to manage your entire ad account
100%
scriptable for CI/CD and automation
5 commands. Full campaign lifecycle.
Create campaigns, check status, pause, activate, and list. Each command maps directly to the Meta Ads API.
Example usage
$ meta-ads create --budget 500 --audience "dentists, US" \
--image ./hero.jpg --headline "AI Receptionist" \
--cta "Learn More" --link https://attainmentlabs.com
Campaign created (PAUSED): 120215553456789
$ meta-ads status 120215553456789
Status: PAUSED | Budget: $500/day | Reach: -- | Spend: $0
$ meta-ads activate 120215553456789
Campaign 120215553456789 is now ACTIVE5 commands included
meta-ads create
Create a campaign with budget, audience, and creatives.
meta-ads status
Check campaign performance and metrics.
meta-ads pause
Pause a live campaign.
meta-ads activate
Go live with a paused campaign.
meta-ads list
List all campaigns in your ad account.
CLI or MCP? Pick your workflow.
Both tools use the same Meta Ads API. The CLI is for terminal workflows. The MCP is for Claude Code users who want natural language.
meta-ads-cli (this tool)
- Terminal commands, no AI required
- Scriptable for automation and CI/CD
- Direct API access, full control
- Familiar CLI workflow for developers
- git clone to install
- Natural language via Claude Code
- Claude handles API complexity
- dry_run mode for safe testing
- Best for non-technical marketers
- uvx install, auto-configured
Get started in 60 seconds.
Install
git clone https://github.com/attainmentlabs/meta-ads-cli cd meta-ads-cli pip install . # Set your Meta credentials export META_ACCESS_TOKEN="your-token" export META_AD_ACCOUNT_ID="your-account-id" export META_PAGE_ID="your-page-id" # You're ready meta-ads list
Need your Meta credentials? Read the setup guide
Want this deployed for your business?
The free tool gets you started. The full version is scoped to your ad strategy, connected to your systems, and built by our team.