Commands

Commands that change files run in dry run mode by default; use -w / --write to persist changes.

  • help - print the tool and commands help text; campi-cli help <COMMAND>
  • version - print the tool version
  • init - create the base config file and prepare the working directory, scaffolding config.campi, example.manifest.campi and .env.example; the interactive mode is reported as not implemented yet
  • fmt - format campi files; -w / --write, --lsp
  • validate - check the config and manifests for correctness
  • config - show the active configuration
  • state - retrieve the current state and compare it against the provided state
  • plan - compare the current manifests against the recorded state and show what would change per enabled platform as a tree of campaigns, ad sets and ads; --export; platforms enabled in a manifest but not configured in config.campi are reported as skipped
  • apply - apply the plan and persist state; -w / --write, --exclude <VALUE>
  • import - import a hand-created campaign into state: import <PLATFORM> <CAMPAIGN> <EXTERNAL_ID>; -w / --write
  • platform - fetch and format platform marketing API data; platform <PLATFORM>; the platform must be one of meta, x, tiktok, google, reddit, linkedin; the meta platform covers Facebook, Instagram, Messenger and other Meta destinations through the Marketing API; platform meta prints the ad account, its pages, linked Instagram accounts and its campaigns as a tree of ad sets and ads; platform google prints the Google Ads account and its campaigns as a tree of ad groups and ads; data fetching is implemented for meta and google, the remaining platforms are reported as not implemented yet

See campi-cli help <COMMAND> for the flags of a specific command.

destroy

Archive the campaigns recorded in state and clear state. Runs in dry run mode by default; use -w or --write to execute. On success the state is cleared.