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

@todoforai/woocommerce-api

v0.1.0

Published

JSON-first CLI for the WooCommerce REST API (wc/v3): products, orders, customers, coupons, refunds

Downloads

210

Readme

WooCommerce REST API CLI

Independent CLI for one WooCommerce store's REST API (wc/v3). It is not an official WooCommerce product. It prints JSON, uses the API's own query and body field names, and requires an explicit --yes for every write.

Auth

Use a store URL plus a REST key pair, sent with HTTP Basic auth over HTTPS. Plain HTTP is accepted only for localhost. WooCommerce rejects consumer keys over plain HTTP.

  • WooCommerce key: WP Admin → WooCommerce → Settings → Advanced → REST API → Add key (Read/Write). This gives you a ck_… key and a cs_… secret.
  • WordPress application password: Users → Profile → Application Passwords. The key is the username and the secret is the generated password.
printf '%s' "$CS" | woocommerce-api auth --url https://shop.example.com --key ck_… --secret-stdin   # verifies via /system_status
woocommerce-api whoami

Setting all three of WOOCOMMERCE_URL, WOOCOMMERCE_KEY and WOOCOMMERCE_SECRET overrides the saved credentials. Credentials are saved in ~/.config/woocommerce-api/credentials.json with mode 0600.

Commands

There are 155 commands in 15 groups. scripts/generate.py generates them from WooCommerce's own route index (GET /wp-json/wc/v3?context=help), dumped from a vanilla WooCommerce 11.1.2 store. Commands are named <group> <sub-resource->verb [ids]:

woocommerce-api products list --search mug --per_page 20
woocommerce-api products create --data '{"name":"Mug","type":"simple","regular_price":"9.99"}' --yes
woocommerce-api products variations-list 10
woocommerce-api orders list --status processing --all
woocommerce-api orders update 123 --data '{"status":"completed"}' --yes
woocommerce-api orders notes-create 123 --data '{"note":"Shipped","customer_note":true}' --yes
woocommerce-api orders refunds-create 123 --data '{"amount":"5.00","api_refund":false}' --yes
woocommerce-api customers delete 7 --force true --yes
woocommerce-api products create --schema           # body fields, offline
woocommerce-api request GET /wp-json/wc-analytics/reports/revenue/stats   # other namespaces / plugins
  • --all follows X-WP-TotalPages with per_page=100.
  • DELETE moves items to the trash unless you pass --force true. Customers and terms require --force true.
  • Routes added by extensions are not generated; reach them with request.

Develop

bun test && bun run test:node

Tested against a local WordPress 7.1.2 + WooCommerce 11.1.2 (docker), with a consumer key over an HTTPS tunnel: product, customer and order create/update/delete, order notes, refunds and --all pagination.