npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@commercelayer/cli-plugin-metrics

v1.0.7

Published

Commerce Layer CLI metrics plugin

Readme

@commercelayer/cli-plugin-metrics

Commerce Layer CLI Metrics plugin

oclif Version Downloads/week License

Usage

commercelayer COMMAND

commercelayer [COMMAND] (--help | -h) for detailed information about plugin commands.

Commands

commercelayer metrics:breakdown RESOURCE

Perform a breakdown query on the Metrics API endpoint.

USAGE
  $ commercelayer metrics:breakdown RESOURCE -b <value> -f <value> -O
    avg|cardinality|max|min|percentiles|stats|sum|value_count [-F <value>] [-B <value>] [-c <value>] [-s asc|desc] [-l
    <value>]

FLAGS
  -B, --breakdown=<value>  the optional nested breakdown
  -F, --filter=<value>     the filter to apply to the query in JSON format (enclosed in single quotes)
  -O, --operator=<option>  (required) the computing operator
                           <options: avg|cardinality|max|min|percentiles|stats|sum|value_count>
  -b, --by=<value>         (required) the field you want the results of the query aggragated by
  -c, --condition=<value>  an additional constraint to fine-tune the set of records
  -f, --field=<value>      (required) the field you want the metrics or statistics computed on
  -l, --limit=<value>      the maximum number of records shown in the response
  -s, --sort=<option>      the way you want the results of the query to be sorted
                           <options: asc|desc>

DESCRIPTION
  perform a breakdown query on the Metrics API endpoint

ALIASES
  $ commercelayer metrics:break
  $ commercelayer breakdown

EXAMPLES
  $ commercelayer metrics:breakdown orders -b order.country_code -f order.id -O value_count -s desc -l 20

  cl breakdown orders -b order.country_code -f order.id -O value_count -s desc -l 20 -B '{"by": "line_items.name","field": "line_items.id","operator": "value_count","sort": "desc","limit": 20}'

FLAG DESCRIPTIONS
  -B, --breakdown=<value>  the optional nested breakdown

    a JSON object (enclosed in single quotes) containing the nested breakdown

  -O, --operator=avg|cardinality|max|min|percentiles|stats|sum|value_count  the computing operator

    the list of valid operators depends on the value of the field key

  -c, --condition=<value>  an additional constraint to fine-tune the set of records

    the condition is applied to the computed results of the query and it is available for operators that return single
    numeric (float or integer) values.

See code: src/commands/metrics/breakdown.ts

commercelayer metrics:date_breakdown RESOURCE

Perform a date breakdown query on the Metrics API endpoint.

USAGE
  $ commercelayer metrics:date_breakdown RESOURCE -b <value> -f <value> -O
    avg|cardinality|max|min|percentiles|stats|sum|value_count [-F <value>] [-B <value>] [-i hour|day|week|month|year]

FLAGS
  -B, --breakdown=<value>  the optional nested breakdown
  -F, --filter=<value>     the filter to apply to the query in JSON format (enclosed in single quotes)
  -O, --operator=<option>  (required) the computing operator
                           <options: avg|cardinality|max|min|percentiles|stats|sum|value_count>
  -b, --by=<value>         (required) the field you want the results of the query aggragated by
  -f, --field=<value>      (required) the field you want the metrics or statistics computed on
  -i, --interval=<option>  the time interval over which the metrics are computed
                           <options: hour|day|week|month|year>

DESCRIPTION
  perform a date breakdown query on the Metrics API endpoint

ALIASES
  $ commercelayer metrics:breakdate
  $ commercelayer metrics:date
  $ commercelayer breakdate
  $ commercelayer date_breakdown

EXAMPLES
  $ commercelayer metrics:date_breakdown orders -b order.placed_at -f order.total_amount_with_taxes -O stats -i month

FLAG DESCRIPTIONS
  -B, --breakdown=<value>  the optional nested breakdown

    a JSON object (enclosed in single quotes) containing the nested breakdown

  -O, --operator=avg|cardinality|max|min|percentiles|stats|sum|value_count  the computing operator

    the list of valid operators depends on the value of the field key

See code: src/commands/metrics/date_breakdown.ts

commercelayer metrics:fbt

Perform a Frequently Bought Together query on the Metrics API analysis endpoint.

USAGE
  $ commercelayer metrics:fbt [-F <value>] [-i <value>...]

FLAGS
  -F, --filter=<value>  the filter to apply to the query in JSON format (enclosed in single quotes)
  -i, --in=<value>...   a list of SKU or bundle IDs associated as line items to one or more orders

DESCRIPTION
  perform a Frequently Bought Together query on the Metrics API analysis endpoint

ALIASES
  $ commercelayer fbt

EXAMPLES
  $ commercelayer metrics:fbt --in xYZkjABcde,yzXKjYzaCx

See code: src/commands/metrics/fbt.ts

commercelayer metrics:search RESOURCE

Perform a search query on the Metrics API endpoint.

USAGE
  $ commercelayer metrics:search RESOURCE -f <value>... [-F <value>] [-l <value>] [-s asc|desc -b <value>] [-c
    <value>]

FLAGS
  -F, --filter=<value>     the filter to apply to the query in JSON format (enclosed in single quotes)
  -b, --sort_by=<value>    the date field you want the results of the query sorted by
  -c, --cursor=<value>     the cursor pointing to a specific page in the paginated search results
  -f, --fields=<value>...  (required) comma-separated list of fields you want to be returned for each record in the
                           response
  -l, --limit=<value>      the maximum number of records shown in the response
  -s, --sort=<option>      the way you want the results of the query to be sorted
                           <options: asc|desc>

DESCRIPTION
  perform a search query on the Metrics API endpoint

ALIASES
  $ commercelayer search

EXAMPLES
  $ commercelayer metrics:search orders -l 5 -s asc -b order.placed_at -f order.id,order.number,order.placed_at,customer.email

See code: src/commands/metrics/search.ts

commercelayer metrics:stats RESOURCE

Perform a stats query on the Metrics API endpoint.

USAGE
  $ commercelayer metrics:stats RESOURCE -f <value> -O avg|cardinality|max|min|percentiles|stats|sum|value_count
    [-F <value>]

FLAGS
  -F, --filter=<value>     the filter to apply to the query in JSON format (enclosed in single quotes)
  -O, --operator=<option>  (required) the computing operator
                           <options: avg|cardinality|max|min|percentiles|stats|sum|value_count>
  -f, --field=<value>      (required) the field you want the metrics or statistics computed on

DESCRIPTION
  perform a stats query on the Metrics API endpoint

ALIASES
  $ commercelayer stats

EXAMPLES
  $ commercelayer metrics:stats orders -f order.total_amount_with_taxes --op avg

  cl stats orders -f order.total_amount_with_taxes -O stats

See code: src/commands/metrics/stats.ts