CLI commands
Every productmetrics command group with its commands, the scope each needs and its key flags, plus productmetrics capabilities and productmetrics call.
productmetrics has one command per public API operation, grouped by the part before the dot in its capability id.
Where you are in onboarding, and moving it forward.
The setup status and the next open step.
Properties, workspaces, checkout, invitations and ad spend.
Google access, accounts, conversion actions and customer lists.
Connect Merchant Center and apply its auto-setup.
Connect a store and check that purchases arrive.
Meta Conversions API and ChatGPT Ads (OpenAI Conversions API).
Product Segmentation settings: read, preview, save.
Rules that override segments or priorities.
Feed source settings and generating the feed.
Inventory planning settings and stock state.
Orders, Business Health, analytics and data queries.
Find a command
The live list always comes from the server:
# every operation: command, scope, whether it changes data
productmetrics capabilities
productmetrics capabilities --search "merchant center"
productmetrics capabilities --scope write --json
# one group
productmetrics <group> --help
# one command: request, scope, every flag, an example
productmetrics <group> <command> --helpHow to read the tables
- Command is
productmetrics <group> <command>.productmetrics call <capability-id>runs the same operation:productmetrics call google_ads.list_accountsisproductmetrics google-ads list-accounts. - What it does links to the operation’s API reference page, with every field.
- Scope is the one scope your sign-in needs. See Authentication.
- Must pass lists the flags the command fails without: its required path, query and body fields, and
--body-file,--if-match,--auto-idempotency-keyor--yeswhere the operation needs them. Every other flag is inproductmetrics <group> <command> --help. - Commands marked Deletes cannot be undone. In a terminal,
productmetricsasks you to type the id instead of--yes.
Ids come from earlier results, never from guesses: property_id and company_id from productmetrics whoami, installation, connection and scope ids from productmetrics tracking get-configuration, rule ids from productmetrics product-rules list.
Onboarding
Where you are in Product Metrics onboarding, and moving it forward.
| Command | What it does | Scope | Must pass |
|---|---|---|---|
productmetrics onboarding get-state | Get onboarding state | read | |
productmetrics onboarding update-step | Move onboarding to a step | setup | --step |
productmetrics onboarding set-account-type | Set account type | setup | --account-type |
productmetrics onboarding set-google-ads-connection-mode | Set Google Ads connection mode | setup | --google-ads-connection-mode |
productmetrics onboarding complete | Complete onboarding | setup | |
productmetrics onboarding skip | Skip onboarding | setup |
Setup
| Command | What it does | Scope | Must pass |
|---|---|---|---|
productmetrics setup get-status | Get setup status | read |
The answer carries journey_stage, user.google_grant, hub.company.next_action and hub.property.next_action.
Workspaces and billing
| Command | What it does | Scope | Must pass |
|---|---|---|---|
productmetrics properties list | List properties | read | |
productmetrics companies list | List workspaces | read | |
productmetrics companies create | Create workspace | setup | --name, --auto-idempotency-key |
productmetrics billing create-checkout-link | Create a checkout link | setup | --company-id |
productmetrics invitations send | Invite teammates | write | --company-id, --invitees |
productmetrics usage get-ad-spend | Get ad spend usage | read | --company-id, --start-date, --end-date |
invitations send takes the invitees as JSON in --invitees (or the whole body in --body). Each role is admin, editor or viewer:
productmetrics invitations send \
--company-id <company_id> \
--invitees '[{ "email": "anna@example.com", "role": "editor" }]'Google Ads
Granting Google access, connecting Google Ads accounts (which creates properties), conversion actions and customer lists.
| Command | What it does | Scope | Must pass |
|---|---|---|---|
productmetrics google get-connect-link | Get the Google connect link | setup | --scope |
productmetrics google-ads list-accounts | List reachable Google Ads accounts | read | |
productmetrics google-ads list-property-connections | List Google Ads connections | read | --company-id |
productmetrics google-ads create-property-connection | Connect a Google Ads account | setup | --company-id, --connection-mode, --customer-id |
productmetrics google-ads list-pending-invites | List pending Google Ads invites | read | --company-id |
productmetrics google-ads send-invite | Invite a Google Ads account | setup | --company-id, --customer-id |
productmetrics google-ads recheck-property-connection | Recheck a Google Ads connection | setup | --property-id |
productmetrics google-ads delete-property-connection | Deletes. Disconnect a Google Ads account | setup | --property-id, --yes |
productmetrics google-ads get-setup-status | Get workspace setup status | read | --company-id |
productmetrics google-ads get-plan-results | Get plan results | read | --property-id |
productmetrics google-ads get-conversion-actions | Get conversion action readiness | read | --property-id |
productmetrics google-ads create-conversion-actions | Create conversion actions | setup | --property-id, --company-id |
productmetrics google-ads get-customer-lists | Get customer lists | read | --property-id, --company-id |
productmetrics google-ads create-customer-lists | Create customer lists | setup | --property-id, --company-id |
Merchant Center
| Command | What it does | Scope | Must pass |
|---|---|---|---|
productmetrics merchant-center create-connection | Connect Merchant Center | setup | --property-id, --merchant-id |
productmetrics merchant-center recheck-connection | Recheck a Merchant Center connection | setup | --property-id |
productmetrics merchant-center delete-connection | Deletes. Disconnect Merchant Center | setup | --property-id, --yes |
productmetrics merchant-center inspect-auto-setup | Inspect Merchant Center auto-setup | read | --property-id |
productmetrics merchant-center get-auto-setup-status | Get Merchant Center auto-setup status | read | --property-id |
productmetrics merchant-center apply-auto-setup | Apply Merchant Center auto-setup | setup | --property-id |
Stores and tracking
Connecting a store and checking that purchases arrive.
| Command | What it does | Scope | Must pass |
|---|---|---|---|
productmetrics stores select-platform | Choose the store platform | setup | --company-id, --platform |
productmetrics stores connect | Connect a store | setup | --company-id, --provider |
productmetrics stores create-woocommerce-setup-claim | New WooCommerce setup token | setup | --installation-id |
productmetrics tracking get-configuration | Get tracking configuration | read | --company-id, --property-id |
productmetrics tracking get-commerce-configuration | Get store connections | read | --company-id |
productmetrics tracking create-website-installation | Track a website | setup | --company-id, --verified-domain |
productmetrics tracking get-last-purchase | Check tracking works | read | --company-id, --installation-id |
productmetrics tracking get-shopware6-status | Get Shopware 6 status | read | --company-id, --installation-id |
productmetrics tracking update-installation-features | Set the cookie consent manager and tracking features | setup | --company-id, --installation-id, --identity-discovery, --dynamic-checkout-observation, --cmp-adapter, --expanded-bot-signals, --server-authoritative-attribution-mode |
productmetrics tracking update-margin-policy | Set the profit cost fallback and margin costs | setup | --company-id, --connection-id, --expected-revision, --policy, --auto-idempotency-key |
productmetrics tracking update-scope-dimensions | Set a store’s countries and currencies | setup | --company-id, --scope-id, --installation-id, --country-codes, --path-prefixes, --locale-codes, --currency-codes |
productmetrics tracking set-scope-destination | Send a store’s purchases to Google Ads | setup | --company-id, --scope-id, --installation-id, --property-id, --pageview-destination, --consent-policy-version |
productmetrics tracking assign-property | Assign a store to a property | setup | --company-id, --scope-id, --installation-id, --property-id |
productmetrics tracking get-enhanced-conversions | Get enhanced conversions readiness | read | --company-id, --property-id |
stores connect answers per platform:
| Platform | Answer | Exit |
|---|---|---|
| Shopify | mode: redirect and an authorizationUrl to approve in Shopify Admin | 4, next_action.type: "browser" |
WooCommerce, Shopware 6 (--store-url) | mode: plugin_claim and a one-time setup token to paste into the Product Metrics plugin before claim.expiresAt | 4, next_action.type: "store_plugin" |
Lightspeed C-Series (--cluster, --shop-domain, --shop-id, --api-key, --api-secret) | mode: provisioning: the connection is being set up |
Pass --auto-idempotency-key too, so a retry does not start a second connection. stores connect and stores create-woocommerce-setup-claim hide the setup token unless you pass --show-secrets. Then productmetrics tracking get-commerce-configuration shows the connection become active.
A WooCommerce store on plugin 1.0.12 or later sends its country and currency when it pairs. For any other store, set them with tracking update-scope-dimensions before tracking update-margin-policy: the default margin costs (marginDefaultCatalog in tracking get-configuration) need exactly one country and one currency per store scope.
Destinations
Meta Conversions API and OpenAI Conversions API (ChatGPT Ads) destinations, one per property.
| Command | What it does | Scope | Must pass |
|---|---|---|---|
productmetrics destinations list-meta | List Meta destinations | read | --company-id |
productmetrics destinations set-meta | Save Meta destination | setup | --company-id, --property-id, --pixel-id, --test-event-code, --enabled |
productmetrics destinations test-meta | Send Meta test event | setup | --company-id, --property-id |
productmetrics destinations delete-meta | Deletes. Delete Meta destination | setup | --company-id, --property-id, --yes |
productmetrics destinations list-openai | List ChatGPT Ads (OpenAI Conversions API) destinations | read | --company-id |
productmetrics destinations set-openai | Save ChatGPT Ads (OpenAI Conversions API) destination | setup | --company-id, --property-id, --pixel-id, --enabled |
productmetrics destinations test-openai | Send ChatGPT Ads (OpenAI Conversions API) test event | setup | --company-id, --property-id |
productmetrics destinations delete-openai | Deletes. Delete ChatGPT Ads (OpenAI Conversions API) destination | setup | --company-id, --property-id, --yes |
Settings
Product Segmentation settings: read, get a recommended minimum clicks, preview a draft, save it. Every command takes --feed-scope (a feed id, or all).
| Command | What it does | Scope | Must pass |
|---|---|---|---|
productmetrics settings get | Get Product Segmentation settings | read | --property-id |
productmetrics settings recommend-min-clicks | Recommend minimum clicks | read | --property-id |
productmetrics settings preview | Preview Product Segmentation settings | read | --property-id, --body-file |
productmetrics settings preview-strategy | Preview segmentation strategy | read | --property-id, --body-file |
productmetrics settings update | Save Product Segmentation settings | write | --property-id, --labelizer-settings |
productmetrics settings get --property-id <property_id> --json > settings.json
productmetrics settings recommend-min-clicks --property-id <property_id>
productmetrics settings preview \
--property-id <property_id> \
--feed-scope <feed> \
--body-file draft.json
productmetrics settings update \
--property-id <property_id> \
--body-file new-settings.json \
--if-match '"<settings_version>"'Product rules
Rules that override segments or priorities for the products they match. Every command takes --feed-scope.
| Command | What it does | Scope | Must pass |
|---|---|---|---|
productmetrics product-rules list | List product rules | read | --property-id |
productmetrics product-rules get-impact | Get product rules impact | read | --property-id |
productmetrics product-rules preview | Preview product rule conditions | read | --property-id, --when-cols, --when-ops, --when-vals |
productmetrics product-rules create | Create a product rule | write | --property-id, --name, --when-cols, --when-ops, --when-vals, --target-cols, --action, --action-value |
productmetrics product-rules reorder | Reorder product rules | write | --property-id, --rules |
productmetrics product-rules update | Update a product rule | write | --property-id, --rule-id |
productmetrics product-rules toggle | Turn a product rule on or off | write | --property-id, --rule-id |
productmetrics product-rules delete | Deletes. Delete a product rule | write | --property-id, --rule-id, --yes |
Feed
| Command | What it does | Scope | Must pass |
|---|---|---|---|
productmetrics feed-source-settings get | Get feed source settings | read | --property-id |
productmetrics feed-source-settings update | Save feed source settings | write | --property-id, --product-segment, --category-priority |
productmetrics feed generate | Generate the feed now | write | --property-id |
Inventory
| Command | What it does | Scope | Must pass |
|---|---|---|---|
productmetrics inventory-settings get | Get inventory planning settings | read | --property-id |
productmetrics inventory-settings update | Save an inventory planning setting | write | --property-id, --store-id, --scope-kind, --lead-time-days, --safety-buffer-days |
productmetrics inventory get-state | Get inventory state | read | --property-id |
Store data
The store’s own data. Orders, Business Health and inventory need Pro.
| Command | What it does | Scope | Must pass |
|---|---|---|---|
productmetrics orders get-availability | Check orders are available | read | |
productmetrics orders list | List orders | read | --company-id, --storefront-scope-id |
productmetrics orders get | Get an order | read | --company-id, --order-id, --storefront-scope-id |
productmetrics store list-shops | List shops | read | --property-id |
productmetrics store get-health-slice | Get Business Health | read | --property-id, --window-days, --compare |
productmetrics store get-health-series | Get Business Health series | read | --property-id, --weeks, --compare |
productmetrics store list-health-products | List Business Health products | read | --property-id, --window-days |
productmetrics analytics get-status | Get analytics status | read | --property-id |
productmetrics data query | Query the lake | read | --property-id, --sql |
productmetrics insights get | Get an insight card | read | --property-id, --spot |
productmetrics tracking get-configuration \
--company-id <company_id> \
--property-id <property_id>
productmetrics orders list \
--company-id <company_id> \
--storefront-scope-id <scope_id> \
--limit 20
productmetrics data query \
--property-id <property_id> \
--sql "select count(*) from orders" \
--max-rows 10Feedback
productmetrics feedback sends feedback to the Product Metrics team through feedback.send (scope read). It is not a support channel; leave out personal data. The message can be the argument or --message; --about <capability-id> fills --context and --feature, and --request-id adds a failed call’s request id.
productmetrics feedback \
--sentiment negative \
--about settings.update \
--request-id <request_id> \
--message "The save answered 500 twice."Capabilities and call
productmetrics capabilities lists every operation the server offers, with the command that runs each, its scope and whether it changes data. With --json, each entry also has command, secret_fields and browser_step.
| Flag | What it does |
|---|---|
--search <text> | Only operations whose id, title or description contains this text |
--scope read|setup|write | Only operations that need this scope |
productmetrics call <capability-id> runs an operation by its id (with _ or -), with the same field flags as the generated command:
productmetrics call google_ads.list_accounts
productmetrics call settings.get --param propertyId=<property_id> --jsonFlags every API command takes
Besides its field flags, every API command takes these.
| Flag | What it does |
|---|---|
--param <key=value> | Set a path parameter by its API name (wins over its field flag) |
--query <key=value> | Set a query parameter by its API name (wins over its field flag) |
--body <json> | The JSON body; its keys win over field flags |
--body-file <path> | Read the JSON body from a file |
--body-stdin | Read the JSON body from stdin |
--idempotency-key <uuid> | Idempotency-Key header: the same key makes a retry safe |
--auto-idempotency-key | Send a new random Idempotency-Key (a failed call prints it for the retry) |
--if-match <version> | If-Match header: the version of the resource this change is based on |
--show-secrets | Print fields the API marks as secret instead of hiding them |
--yes | Confirm an operation that deletes data, without a prompt |
--dry-run | Print the request that would be sent, and send nothing |
Only these commands take an Idempotency-Key; on any other, --auto-idempotency-key or --idempotency-key is a usage error (exit 2):
productmetrics companies create(required)productmetrics stores connectproductmetrics tracking update-margin-policy(required)