Meta Marketing CLI for authentication lifecycle, Graph API requests, campaign/ad/adset writes, insights reporting, and Instagram publishing. Use when handling Meta ads or Instagram operations from terminal commands with strict fail-closed behavior.
Use meta for Meta Marketing API and Instagram workflows.
Fail closed: if required inputs are missing or any command fails, stop immediately and surface the error.
Install
go install github.com/bilalbayram/metacli/cmd/meta@latestmeta --helpHuman-required auth bootstrap (must happen first)
APP_ID and APP_SECRET.REDIRECT_URI.cloudflared tunnel --url http://127.0.0.1:53682 (or similar, it must be HTTPS)REDIRECT_URI=https://<tunnel-domain>/oauth/callbackmeta auth setup --profile <PROFILE> --app-id <APP_ID> --app-secret <APP_SECRET> --redirect-uri <REDIRECT_URI> --mode both --scope-pack solo_smb --listen 127.0.0.1:53682 --timeout 180s --open-browser=falseauth_url on their own machine, logs in, and grants consent.meta auth validate --profile <PROFILE> --min-ttl 72hCommon commands
meta schema sync --schema-dir ~/.meta/schema-packsmeta --profile <PROFILE> insights accounts list --active-only --output tablemeta --profile <PROFILE> api get act_<AD_ACCOUNT_ID>/campaigns --fields id,name,status --limit 100 --follow-nextmeta --profile <PROFILE> campaign create --account-id <AD_ACCOUNT_ID> --params "name=<NAME>,objective=OUTCOME_SALES,status=PAUSED" --schema-dir ~/.meta/schema-packs --dry-runmeta --profile <PROFILE> campaign create --account-id <AD_ACCOUNT_ID> --params "name=<NAME>,objective=OUTCOME_SALES,status=PAUSED" --schema-dir ~/.meta/schema-packsmeta --profile <PROFILE> campaign update --campaign-id <CAMPAIGN_ID> --params "daily_budget=<AMOUNT_IN_MINOR_UNITS>" --confirm-budget-changemeta --profile <PROFILE> insights run --account-id <AD_ACCOUNT_ID> --date-preset last_7d --level campaign --metric-pack quality --format jsonlmeta --profile <PROFILE> ig publish feed --media-url <HTTPS_MEDIA_URL> --caption "<CAPTION>" --idempotency-key <UNIQUE_KEY>Rules
--output json or --format jsonl) for automation.APP_SECRET, access tokens) when echoing commands/results.