> ## Documentation Index
> Fetch the complete documentation index at: https://www.adjar.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Adjar CLI Reference

The Adjar CLI is the primary interface for managing your ad accounts as version-controlled TOML config. It works the same across platforms — **Google Ads** and **OpenAI Ads** today — with the platform read from each config's `platform` field. Set up your credentials, then use `import`, `plan`, `apply`, and `report` to pull your live account into plain text, review every proposed change as a human-readable diff, push updates back to the platform with full confidence, and measure the result. The entire workflow is designed to be auditable, reversible, and automation-friendly.

Not installed yet? The [Quick Start](/docs/quickstart) covers installation and your first end-to-end loop.

## The core workflow

Adjar keeps two kinds of plain-text artifact in a git repo: your **ads config** (`.toml`) — the source of truth for campaigns, budgets, and creatives — and your **performance reports** (`.md`). The four commands move data between your live ad account and those files, and an AI agent reads and edits them to drive the loop. Every change is a git commit, so the whole account carries a reviewable, revertible history — and the report from one round becomes the input to the next.

<img src="https://mintcdn.com/adjar/XVhVa6UM9d6843Lp/images/core-workflow.svg?fit=max&auto=format&n=XVhVa6UM9d6843Lp&q=85&s=f42da3bd0fe3e191155dccf11eddaf1d" alt="The Adjar core workflow as a loop: adjar import pulls the live account (Google Ads or OpenAI Ads) into plain-text TOML config, and adjar report pulls performance into Markdown reports — both versioned in git. The AI agent reads the reports and edits the config; adjar plan shows you the diff, you review and approve, and adjar apply pushes the change back to the ad platform." width="820" height="442" data-path="images/core-workflow.svg" />

Each command is defined by what plain-text file it produces or consumes:

<Steps>
  <Step title="Import — produces the ads config">
    [`adjar import`](/docs/cli/import) reads your live account and writes it out as TOML config. Run it once to get started, or again any time to refresh from the live account. Commit the result as your baseline — every future change is a diff against it.
  </Step>

  <Step title="Plan — consumes the config, produces a diff">
    Edit the TOML files (by hand or via your agent), then run [`adjar plan`](/docs/cli/plan) to preview every change as a human-readable diff against the live account. Plan is read-only — it never touches your live account. Nothing ships until you've seen exactly what will change.
  </Step>

  <Step title="Apply — pushes the config to the platform">
    Once the plan looks right, [`adjar apply`](/docs/cli/apply) executes it against the ad platform's API and writes any newly assigned IDs back into your config files, keeping repo and live account in sync. Commit after every apply, so each change is a labeled point in git history you can revert to.
  </Step>

  <Step title="Report — produces a performance report">
    [`adjar report`](/docs/cli/report) pulls a day or month of live performance as data-only Markdown. This is the measure step: the agent reads the report alongside the config — its full context — and what it surfaces becomes the next round's edits.
  </Step>
</Steps>

Because both the config and the reports are just text in the repo, any AI agent can read the current state *and* how it's performing, then propose the next change as a TOML edit. You stay in the loop at `plan`/`apply`: the agent drafts, you review the diff, and only you approve what goes live.

## Authentication

Each platform's credentials live in a JSON file — `google.json` for Google Ads, `openai.json` for OpenAI Ads — that you point Adjar at with `--credentials` or the `ADJAR_CREDENTIALS` environment variable. There are no default locations; credentials are always explicit. The setup guides walk through producing each file, its fields, and how Adjar resolves it:

* [Get Google Ads API access](/docs/google-ads-api-access) — OAuth credentials for Google Ads
* [Get OpenAI Ads API access](/docs/openai-ads-api-access) — the bearer API key for OpenAI Ads

## Command summary

| Command                       | What it does                               |
| ----------------------------- | ------------------------------------------ |
| [`adjar import`](/docs/cli/import) | Export your live account to TOML config    |
| [`adjar plan`](/docs/cli/plan)     | Preview changes as a diff (read-only)      |
| [`adjar apply`](/docs/cli/apply)   | Apply the diff to your live account        |
| [`adjar report`](/docs/cli/report) | Pull a daily or monthly performance report |

## Global flags

<ParamField query="-h, --help" type="flag">
  Print usage information and exit. Available on `adjar` and every subcommand (e.g. `adjar plan --help`).
</ParamField>

<ParamField query="-V, --version" type="flag">
  Print the installed Adjar CLI version and exit. Available on the top-level `adjar` command only.
</ParamField>
