An installable, agent-friendly CLI for the Metorik API.
It is built for the current beta API on metorik.dev, with a shape that feels close to newer API CLIs: easy install, token auth, JSON-first output, and direct endpoint coverage for agents and automation.
npm install -g metorikYou can also run it without installing globally:
npx metorik@latest commands
pnpm dlx metorik commands
bunx metorik commandsStore your API key locally:
metorik auth login YOUR_API_KEY
metorik auth loginGet your key here:
https://app.metorik.com/settings/stores/current?area=api
Or use environment variables:
export METORIK_API_KEY=YOUR_API_KEY
export METORIK_BASE_URL=https://app.metorik.com/api/v1/store- JSON-first output for agents, scripts, and piping into other tools
- simple top-level resource commands for common data endpoints
- grouped report and Engage commands that mirror the docs closely
requestescape hatch for anything new in the API before a first-class command landscommandsendpoint catalog so an agent can discover supported operations quickly
Search customers:
metorik search customers jarvis --count 5Get the last 30 days of product sales:
metorik products --last 30 --search hoodie --per-page 25Revenue by date:
metorik reports revenue-by-date --last 30 --group-by dayRevenue grouped by billing country:
metorik reports revenue-grouped-by --last 90 --grouped-by billing_address_countryCreate or update an Engage profile:
metorik engage profile upsert \
--email taylor@example.com \
--first-name Taylor \
--last-name Smith \
--consent singleCall an endpoint directly:
metorik request GET /reports/sources-utms \
--query start_date=2026-03-01 \
--query end_date=2026-03-31 \
--query source_type=utm_source,utm_campaignList supported built-in commands:
metorik commandsTop-level data endpoints:
metorik storemetorik search <resource> <query>metorik productsmetorik variationsmetorik categoriesmetorik brandsmetorik couponsmetorik custom-metricsmetorik custom-metrics value <metric>
Reports:
metorik reports customers-by-datemetorik reports orders-by-datemetorik reports revenue-by-datemetorik reports profit-by-datemetorik reports advertising-costs-by-datemetorik reports subscriptions-statsmetorik reports revenue-grouped-bymetorik reports orders-grouped-bymetorik reports customers-grouped-bymetorik reports sourcesmetorik reports sources-landingmetorik reports sources-utmsmetorik reports customer-sourcesmetorik reports customer-sources-landingmetorik reports customer-sources-utms
Note: --group-by hour is only valid on the time-series report endpoints when the selected range is under 1 month.
Engage:
metorik engage profile upsertmetorik engage profile getmetorik engage profile deletemetorik engage unsubscribes listmetorik engage unsubscribes statusmetorik engage unsubscribes addmetorik engage unsubscribes remove
npm install
npm run build
npm testLink the package into your global npm bin:
npm run link-localThen you can use it like a normal installed CLI:
metorik commands
metorik auth login YOUR_API_KEY
metorik products --last 30Remove the local link when you are done:
npm run unlink-localIf you update the source, rebuild before testing the linked binary:
npm run buildnvm use 20
yarn
yarn run build
npm publish --access public