> ## Documentation Index
> Fetch the complete documentation index at: https://www.productmetrics.io/docs/nl/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://www.productmetrics.io/docs/nl/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://www.productmetrics.io/docs/api/mcp.
> Every agent surface: https://www.productmetrics.io/docs/.well-known/llms-manifest.json

# Product Metrics CLI (/docs/nl/cli/overview)

<!-- agent-signals: reading_time_min: 4 · est_tokens: 1839 · updated: 2026-12-03 -->
Related: [Quickstart voor developers en agents](/docs/nl/cli/quickstart.md), [CLI-authenticatie](/docs/nl/cli/authentication.md), [CLI-commando's](/docs/nl/cli/commands.md), [De CLI gebruiken vanuit een AI-agent](/docs/nl/cli/for-agents.md), [JSON-uitvoer en exitcodes](/docs/nl/cli/json-and-exit-codes.md), [Introductie](/docs/nl.md)

> productmetrics, de command line van Product Metrics: elke openbare API-handeling als commando, met JSON-uitvoer en exitcodes voor scripts en agents.

`productmetrics` is de command line van Product Metrics. Hij roept de [openbare API](/docs/api/overview) (`/api/public/v1`) aan en bouwt zijn commando's, flags en help op uit de eigen lijst met handelingen van de server, dus een nieuwe API-handeling werkt zonder nieuwe CLI-release.



* [Quickstart](/docs/nl/cli/quickstart): stel Product Metrics van begin tot eind in vanuit de terminal
* [Authenticatie](/docs/nl/cli/authentication): `productmetrics login`, scopes en `PM_TOKEN`
* [Commando's](/docs/nl/cli/commands): elke commandogroep, met de scope en flags
* [JSON en exitcodes](/docs/nl/cli/json-and-exit-codes): de `--json`-envelop, `next_action` en exitcodes 0 tot en met 4
* [Voor agents](/docs/nl/cli/for-agents): `productmetrics` aansturen vanuit Claude Code, Codex of een script
* [Gebruik het vanuit een AI-app](/docs/nl/mcp/overview): voeg Product Metrics als connector toe aan Claude, ChatGPT of Cursor

## Installeren en starten

Installeer hem vanuit npm (Node.js 22 of later):



```bash
npm install -g @productmetrics/cli
productmetrics --help
# of één keer, zonder te installeren
npx @productmetrics/cli --help
```

De voorbeelden op deze pagina's schrijven `productmetrics`. Standaard praat hij met `https://prod-backend.productmetrics.io`. `productmetrics status` toont welke API hij gebruikt.

## Inloggen en een commando uitvoeren

```bash
# opent de browser; klik op Connect Product Metrics CLI
productmetrics login
# je account (e-mailadres) en properties
productmetrics whoami
# een handeling zoeken
productmetrics capabilities --search settings
productmetrics settings get --property-id <property_id> --json
```

Het laatste commando toont de instellingen als JSON:

```text
{
  "ok": true,
  "data": {
    "labelizer_settings": { … },
    "settings_version": 4,
    …
  },
  "request_id": "…"
}
```

## Help

```bash
# elk commando en elke API-groep
productmetrics --help
# de commando's van één groep
productmetrics google-ads --help
# één commando: verzoek, scope, flags, voorbeelden
productmetrics settings update --help
# hoe een AI-agent productmetrics moet gebruiken
productmetrics help agents
```

`productmetrics`, `productmetrics help` en elke `--help` tonen dezelfde opbouw: gebruik, commando's, flags met hun typen, standaardwaarden en toegestane waarden, en voorbeelden.

* Voeg `--json` toe voor een machineleesbare beschrijving.
* Helponderwerpen: `productmetrics help agents`, `productmetrics help exit-codes`, `productmetrics help json`.

## Hoe commando's aansluiten op de API

Elke API-handeling is een commando. De capability-ID geeft het commando: `group.command`, waarbij `_` wordt omgezet in `-`.

| Capability-ID                      | Commando                                          |
| ---------------------------------- | ------------------------------------------------- |
| `google_ads.list_accounts`         | `productmetrics google-ads list-accounts`         |
| `settings.recommend_min_clicks`    | `productmetrics settings recommend-min-clicks`    |
| `merchant_center.apply_auto_setup` | `productmetrics merchant-center apply-auto-setup` |

Elke padparameter, queryparameter en elk bodyveld op het hoogste niveau is een flag in kebab-case:

| Veld                 | Flag                         |
| -------------------- | ---------------------------- |
| `propertyId`         | `--property-id`              |
| `feed_scope`         | `--feed-scope`               |
| `labelizer_settings` | `--labelizer-settings '{…}'` |

`productmetrics call <capability-id>` voert dezelfde handeling uit op basis van de ID. Zie [Commando's](/docs/nl/cli/commands).

## Ingebouwde commando's

| Command                       | What it does                                                     |
| ----------------------------- | ---------------------------------------------------------------- |
| `productmetrics login`        | Sign in to Product Metrics in a browser                          |
| `productmetrics logout`       | Sign out of this API origin                                      |
| `productmetrics status`       | Show which API productmetrics uses and whether you are signed in |
| `productmetrics whoami`       | Check the sign-in against the API: your account and properties   |
| `productmetrics capabilities` | List every API operation                                         |
| `productmetrics call`         | Run an operation by its id                                       |
| `productmetrics feedback`     | Tell the Product Metrics team what worked or did not             |
| `productmetrics mcp-config`   | Show how to add Product Metrics to Claude, ChatGPT or Cursor     |
| `productmetrics help`         | Help for a command or topic                                      |

`productmetrics agents` is de korte vorm van `productmetrics help agents`.

## Algemene flags

| Flag              | What it does                                                                                        |
| ----------------- | --------------------------------------------------------------------------------------------------- |
| `--api <origin>`  | The Product Metrics API to use (default `https://prod-backend.productmetrics.io`, env `PM_API_URL`) |
| `--json`          | Print one JSON document on stdout (\{ok, data, request_id} or \{ok: false, error, exit_code})       |
| `--select <path>` | Print only part of the JSON document, e.g. .data.properties\[].property_id (implies --json)         |
| `-q, --quiet`     | Print only the primary id of the result, or nothing                                                 |
| `--verbose`       | Log requests, timings and request ids to stderr (never tokens or bodies)                            |
| `--no-input`      | Never prompt or open a browser (on by default without a terminal; env `PM_AGENT=1`, `CI`)           |
| `--no-color`      | No colours (env `NO_COLOR`)                                                                         |
| `--refresh`       | Fetch the server's command list again (it is cached for an hour)                                    |
| `-h, --help`      | Show help; with --json, a machine-readable description                                              |
| `-v, --version`   | Show the version                                                                                    |

## Waar dingen worden opgeslagen

* **Inloggegevens:** `${XDG_CONFIG_HOME:-~/.config}/product-metrics/credentials.json`, één item per API-origin, modus 0600 in een map met 0700.
* **Cache van de commandolijst** (één uur): `${XDG_CACHE_HOME:-~/.cache}/product-metrics/`.

## Gebruik het in plaats daarvan vanuit een AI-app

`productmetrics mcp-config --client claude|chatgpt|cursor` toont de URL van de MCP-server en hoe je die als connector toevoegt. Connectors loggen in via de browser en hebben geen token nodig. Zie [MCP](/docs/nl/mcp/overview).

## Volgende stappen



* [Quickstart](/docs/nl/cli/quickstart): workspace, Google Ads, webshop en conversieacties, stap voor stap
* [Commando's](/docs/nl/cli/commands): elke commandogroep
* [API-overzicht](/docs/api/overview): dezelfde handelingen via HTTP
* [Agent skills](/docs/agent-skills/overview): taakinstructies die een agent vertellen welke commando's hij moet uitvoeren
