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

# CLI commands

> Complete reference for every geo CLI subcommand.

Each section below covers one subcommand, its flags, and what it prints.

## `geo init`

Initialize project directories and database.

**Flags:** None

Creates `db/`, `raw/`, `cache/`, `reports/` directories under the data root (default `./data`). Initializes the SQLite schema at `data/db/geo.sqlite3`. Loads all brand YAML files, engines, and presets, printing a summary.

Requires four environment variables: `OPENROUTER_API_KEY`, `GOOGLE_WORKSPACE_CLI_CLIENT_ID`, `GOOGLE_WORKSPACE_CLI_CLIENT_SECRET`, `GOOGLE_ANALYTICS_REFRESH_TOKEN`.

***

## `geo status`

Show database and configuration status.

**Flags:** None

Prints the database path, file size, table row counts, last run per brand, and pending extraction count.

***

## `geo run`

Run brand-visibility prompts.

| Flag             | Type   | Default | Description                                     |
| ---------------- | ------ | ------- | ----------------------------------------------- |
| `--operation-id` | string | —       | Server-issued metered operation id              |
| `--brand`        | string | —       | Brand key from `brands/<key>.yaml`              |
| `--all-brands`   | flag   | false   | Run every configured brand                      |
| `--preset`       | string | —       | Preset name (default: `standard`)               |
| `--engines`      | string | —       | Comma-separated engine keys                     |
| `--smoke`        | flag   | false   | Force the smoke preset                          |
| `--resume`       | string | —       | Resume an existing run by RUN\_ID               |
| `--dry-run`      | flag   | false   | Print the matrix and cost without network calls |

Prints the prompt/engine matrix, cost summary, and run ID on completion.

***

## `geo research run`

Run evidence-grounded market and ICP research (five-stage frozen DAG).

| Flag             | Type   | Default  | Description                        |
| ---------------- | ------ | -------- | ---------------------------------- |
| `--operation-id` | string | required | Server-issued metered operation id |

Prints the research run ID and artifact count.

***

## `geo extract`

Extract mentions, citations, and sentiment from responses.

| Flag               | Type   | Default | Description                                                   |
| ------------------ | ------ | ------- | ------------------------------------------------------------- |
| `--brand`          | string | —       | Brand key from `brands/<key>.yaml`                            |
| `--run`            | string | —       | Process only responses from this run                          |
| `--reextract`      | flag   | false   | Reprocess already-extracted responses with new schema version |
| `--schema-version` | string | `v1`    | Schema version tag                                            |

Prints per-response mention/citation counts, total cost, and error count.

***

## `geo prompts`

Manage generated prompt sets. Requires a subcommand.

### `geo prompts seed`

Build GSC and brain seed corpus.

| Flag      | Type   | Default  | Description |
| --------- | ------ | -------- | ----------- |
| `--brand` | string | required | Brand key   |

Prints the number of seeds written.

### `geo prompts generate`

Generate candidate prompts.

| Flag             | Type   | Default  | Description                                                     |
| ---------------- | ------ | -------- | --------------------------------------------------------------- |
| `--brand`        | string | optional | Brand key (inferred from metering when `--operation-id` is set) |
| `--operation-id` | string | —        | Server-issued metered operation id                              |
| `--dry-run`      | flag   | false    | Print planned cells without LLM calls                           |

When `--operation-id` is set, performs metered, token-authorized generation. When omitted (and `--dry-run` is set), uses the ambient brand config.

### `geo prompts curate`

Fill the active prompt quotas.

| Flag      | Type   | Default  | Description |
| --------- | ------ | -------- | ----------- |
| `--brand` | string | required | Brand key   |

Prints the number of activated prompts and coverage matrix.

### `geo prompts discriminate`

Run the adversarial critic loop.

| Flag      | Type   | Default  | Description |
| --------- | ------ | -------- | ----------- |
| `--brand` | string | required | Brand key   |

Prints approval rate, round count, and paraphrase count.

### `geo prompts relabel`

Replace lexical topic labels with domain topics.

| Flag        | Type   | Default  | Description                                          |
| ----------- | ------ | -------- | ---------------------------------------------------- |
| `--brand`   | string | required | Brand key                                            |
| `--dry-run` | flag   | false    | Print the old-to-new mapping without database writes |

Interactive: prompts for confirmation before applying.

### `geo prompts status`

Show the prompt coverage matrix.

| Flag      | Type   | Default  | Description |
| --------- | ------ | -------- | ----------- |
| `--brand` | string | required | Brand key   |

### `geo prompts add`

Add a user-authored prompt.

| Flag           | Type   | Default  | Description                      |
| -------------- | ------ | -------- | -------------------------------- |
| `--brand`      | string | required | Brand key                        |
| `--text`       | string | required | Prompt text                      |
| `--intent`     | string | required | Intent (must be in brand quotas) |
| `--topic`      | string | required | Topic label                      |
| `--lang`       | string | required | Language code                    |
| `--importance` | float  | —        | Importance weight                |

Prints the new prompt ID.

### `geo prompts edit`

Edit a prompt's fields.

| Flag           | Type   | Default  | Description    |
| -------------- | ------ | -------- | -------------- |
| `--brand`      | string | required | Brand key      |
| `--id`         | string | required | Prompt ID      |
| `--text`       | string | —        | New text       |
| `--intent`     | string | —        | New intent     |
| `--topic`      | string | —        | New topic      |
| `--lang`       | string | —        | New language   |
| `--importance` | float  | —        | New importance |

Prints the updated or archived-and-recreated prompt ID.

### `geo prompts archive`

Deactivate a prompt.

| Flag      | Type   | Default  | Description |
| --------- | ------ | -------- | ----------- |
| `--brand` | string | required | Brand key   |
| `--id`    | string | required | Prompt ID   |

### `geo prompts restore`

Reactivate a prompt.

| Flag      | Type   | Default  | Description |
| --------- | ------ | -------- | ----------- |
| `--brand` | string | required | Brand key   |
| `--id`    | string | required | Prompt ID   |

***

## `geo recs`

List, inspect, and update recommendations. Requires a subcommand.

### `geo recs generate`

Create a metered, idempotent recommendation batch.

| Flag                | Type   | Default  | Description                        |
| ------------------- | ------ | -------- | ---------------------------------- |
| `--operation-id`    | string | required | Server-issued metered operation id |
| `--idempotency-key` | string | required | Unique idempotency key             |

Prints the generated recommendations as JSON.

### `geo recs list`

List recommendations for a brand.

| Flag       | Type   | Default    | Description                     |
| ---------- | ------ | ---------- | ------------------------------- |
| `--brand`  | string | required   | Brand key                       |
| `--status` | string | `proposed` | Recommendation status to filter |
| `--json`   | flag   | false      | Print a JSON array              |

Prints a formatted table or JSON array.

### `geo recs show`

Show a complete recommendation.

| Flag                    | Type       | Default  | Description                |
| ----------------------- | ---------- | -------- | -------------------------- |
| `rec_id`                | positional | required | Recommendation ID          |
| `--json`                | flag       | false    | Print JSON                 |
| `--include-transitions` | flag       | false    | Include transition history |

### `geo recs draft`

Generate a draft comment for a Reddit recommendation.

| Flag      | Type   | Default  | Description       |
| --------- | ------ | -------- | ----------------- |
| `--brand` | string | required | Brand key         |
| `--id`    | string | required | Recommendation ID |

Prints the draft as JSON.

### `geo recs transition`

Execute a CAS-guarded lifecycle transition.

| Flag                    | Type   | Default    | Description                           |
| ----------------------- | ------ | ---------- | ------------------------------------- |
| `--brand`               | string | required   | Brand key                             |
| `--id`                  | string | required   | Recommendation ID                     |
| `--action`              | string | required   | Action (one of the canonical actions) |
| `--expected-status`     | string | required   | Expected current status               |
| `--expected-version`    | int    | required   | Expected version                      |
| `--idempotency-key`     | string | required   | Unique key                            |
| `--actor-kind`          | string | `session`  | Actor kind                            |
| `--actor-id`            | string | `cli-user` | Actor identifier                      |
| `--note`                | string | —          | Transition note                       |
| `--review-evidence`     | string | —          | JSON string of review evidence        |
| `--visibility-snapshot` | string | —          | JSON string of visibility snapshot    |
| `--compliance-approved` | flag   | false      | Mark compliance reviewed              |
| `--draft-id`            | string | —          | Draft identifier                      |
| `--metadata`            | string | —          | JSON object attached to the audit row |
| `--json`                | flag   | false      | Print JSON result                     |

### `geo recs mark`

\[DEPRECATED] Change recommendation status (maps to canonical transitions).

| Flag                          | Type       | Default    | Description                                                       |
| ----------------------------- | ---------- | ---------- | ----------------------------------------------------------------- |
| `--brand`                     | string     | required   | Workspace/brand key                                               |
| `rec_id`                      | positional | required   | Recommendation ID                                                 |
| `status`                      | positional | required   | One of: `accepted`, `shipped`, `verified`, `rejected`, `reopened` |
| `--note`                      | string     | —          | Append an artifact or status note                                 |
| `--expected-status`           | string     | required   | Expected current status                                           |
| `--expected-version`          | int        | required   | Expected version                                                  |
| `--idempotency-key`           | string     | required   | Unique key                                                        |
| `--actor-kind`                | string     | `session`  | Actor kind                                                        |
| `--actor-id`                  | string     | `cli-user` | Actor identifier                                                  |
| `--review-evidence`           | string     | —          | JSON string of review evidence                                    |
| `--visibility-snapshot`       | string     | —          | JSON string of visibility snapshot                                |
| `--draft-id`                  | string     | —          | Draft identifier                                                  |
| `--force-compliance-reviewed` | flag       | false      | Confirm compliance review before shipping                         |

***

## `geo seo`

Run deterministic SEO scoring, insights, and audits. Requires a subcommand.

### `geo seo score`

Compute SEO score.

| Flag             | Type   | Default  | Description                        |
| ---------------- | ------ | -------- | ---------------------------------- |
| `--operation-id` | string | required | Server-issued metered operation id |
| `--date`         | string | —        | Score/window end date (YYYY-MM-DD) |

### `geo seo insights`

Build SEO insights.

| Flag             | Type   | Default  | Description                        |
| ---------------- | ------ | -------- | ---------------------------------- |
| `--operation-id` | string | required | Server-issued metered operation id |
| `--date`         | string | —        | Score/window end date (YYYY-MM-DD) |

### `geo seo audit`

Run a D4 SEO audit.

| Flag             | Type   | Default  | Description                        |
| ---------------- | ------ | -------- | ---------------------------------- |
| `--operation-id` | string | required | Server-issued metered operation id |

***

## `geo metrics`

Compute daily visibility metrics.

| Flag          | Type   | Default | Description                                      |
| ------------- | ------ | ------- | ------------------------------------------------ |
| `--recompute` | flag   | false   | Delete and rewrite selected `metrics_daily` rows |
| `--since`     | string | —       | Only compute run dates on or after YYYY-MM-DD    |

Prints row count, date slices, and calculation version.

***

## `geo report`

Render Markdown and JSON reports.

| Flag      | Type   | Default  | Description                               |
| --------- | ------ | -------- | ----------------------------------------- |
| `--brand` | string | required | Brand key from `brands/<key>.yaml`        |
| `--date`  | string | —        | Run date (YYYY-MM-DD, defaults to latest) |

Prints the Markdown and JSON output file paths.

***

## `geo recommend`

Generate evidence-grounded GEO recommendations.

| Flag        | Type   | Default  | Description                                    |
| ----------- | ------ | -------- | ---------------------------------------------- |
| `--brand`   | string | required | Brand key from `brands/<key>.yaml`             |
| `--window`  | int    | 28       | Trailing analysis window in days               |
| `--dry-run` | flag   | false    | Print gap analysis without LLM calls or writes |

<Warning>
  `geo recommend` without `--dry-run` **always fails by design**. Recommendation
  creation has moved to the token-authorized `geo recs generate` command. Run
  `geo recs generate --operation-id ... --idempotency-key ...` instead.
</Warning>

When `--dry-run` is set, prints a gap analysis table with no side effects.

***

## `geo daily`

Run the complete per-brand daily pipeline.

| Flag        | Type   | Default                 | Description                                      |
| ----------- | ------ | ----------------------- | ------------------------------------------------ |
| `--preset`  | string | `standard`              | Preset name                                      |
| `--brands`  | string | `didit,hi-doctor,sante` | Comma-separated brand keys                       |
| `--dry-run` | flag   | false                   | Print the per-brand plan without writes or calls |

***

## `geo validate`

Run GEO validation gates.

| Flag      | Type   | Default | Description                                                   |
| --------- | ------ | ------- | ------------------------------------------------------------- |
| `--brand` | string | —       | Validate only one brand key                                   |
| `--gate`  | string | `all`   | Gate to run: `all`, `prompts`, `extraction`, `metrics`, `e2e` |
| `--judge` | flag   | false   | Run the live third-family judge prompt sub-gate               |
| `--loop`  | flag   | false   | Retry only failing gates up to three times                    |

***

## `geo costs`

**Not implemented.** This command is a stub that prints `'costs' not implemented` and exits with code 2.
