Skip to content

bidsmith apply

apply is the mutator. It runs the same diff as plan, shows it to you, prompts for confirmation, and only then sends the changes to Google Ads.

It’s idempotent: applying twice in a row does nothing the second time. It’s atomic: either every operation commits, or none of them do (modulo Google’s own consistency guarantees).

Synopsis

Terminal window
bidsmith apply [PATH] [--auto-approve] [--refresh-state] [--verbose]

Arguments

ArgumentDefaultDescription
PATH.File or directory containing .bid files.

Flags

FlagDescription
--auto-approveSkip the interactive yes prompt. Required when stdin is not a TTY (CI, cron, scripts).
--refresh-stateIgnore any cached live state and refetch from the API before computing the diff. The cache is invalidated after a successful apply regardless. See Cut Google Ads API quota usage.
--verbosePrint the outgoing API request envelope and the raw response.

Environment variables

Same as bidsmith plan. See Authentication for the full list.

Exit codes

CodeMeaning
0Apply completed (whether or not anything changed).
1Local validation failed, authentication failed, Google rejected an operation, the user declined the prompt, or any other error.

Examples

Interactive apply

Terminal window
bidsmith apply .

Prints the plan, prompts:

Do you want to perform these actions?
Type 'yes' to confirm.
>

Type yes and press Enter to commit. Anything else aborts (the account is not touched).

Apply from a script or CI

Terminal window
bidsmith apply --auto-approve .

Skips the prompt. Required for non-interactive runs — apply refuses to read yes from a non-TTY stdin, so omitting --auto-approve in CI is a hard error rather than a silent auto-confirm.

Debug an apply that’s misbehaving

Terminal window
bidsmith apply . --verbose

Same as plan --verbose plus the real mutate.

What the prompt does

The prompt is bidsmith’s last line of defense between you and a bad change. It blocks until you type the literal three letters yes followed by Enter. Anything else aborts with no changes.

This is intentional: a wrong key (y, Yes, accidental Enter) should not auto-commit. The prompt is meant to make you re-read the plan before agreeing.

What apply doesn’t yet do

Two known gaps, both on the roadmap:

  • No label-based identity tracking. bidsmith matches resources by name. A future version will tag every managed resource with a bidsmith:address=… label and match by that, making import and removal both possible.
  • No - destroy flow. Resources removed from .bid files aren’t deleted from Google Ads — they’re just “not managed anymore.” Combine with the labels work above to implement real destroy semantics.

For now, the practical pattern is: to remove a campaign, set its status = "REMOVED" in the .bid file rather than deleting the block.

See also