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

@offerkit/cli

v0.2.2

Published

OfferKit command-line interface.

Downloads

428

Readme

@offerkit/cli

Command-line interface for OfferKit.

OfferKit is open-source promotion infrastructure for coupons, gift cards, loyalty, referrals, customer segments, and validation rules. The CLI uses @offerkit/sdk under the hood and talks to the same /api/v1 API as the dashboard, SDK, and MCP server.

Install

npm install -g @offerkit/cli
pnpm add -g @offerkit/cli

The installed binary is offerkit.

Configure

Mint an API key in the OfferKit dashboard at /settings/api-keys, then save it locally:

offerkit login --url https://your-offerkit-deployment --api-key offerkit_...

This writes ~/.offerkitrc with file mode 0600.

You can also use environment variables:

export OFFERKIT_API_URL=https://your-offerkit-deployment
export OFFERKIT_API_KEY=offerkit_...

Environment variables override values from ~/.offerkitrc.

Inspect the active local configuration without making an API call:

offerkit config

Check the configured deployment and authenticated workspace:

offerkit doctor
offerkit whoami

Commands

Most write-heavy commands accept --data with inline JSON, @file.json, or - to read JSON from stdin. Command output is formatted JSON.

Feature-rich resource commands cover vouchers, campaigns, validation rules, customers, segments, promotion tiers, reward types, referrals, loyalty, webhooks, events, orders, API keys, users, workspace settings, audit log, and insights. The generic api command is available as a fallback for exact SDK procedure calls.

Call any OfferKit API procedure by SDK path:

offerkit api validationRules.create \
  --input '{"name":"WAPP25 min spend","appliesTo":"voucher","rule":{">=":[{"var":"order.amount"},25000]}}'

offerkit api campaigns.create \
  --input '{"name":"WAPP25","type":"DISCOUNT","currency":"EUR","validationRuleId":"<RULE_ID>"}'

offerkit api vouchers.create \
  --input '{"code":"WAPP25","campaignId":"<CAMPAIGN_ID>","type":"DISCOUNT","discount":{"type":"AMOUNT","amount":2500}}'

--input accepts inline JSON, @file.json, or - to read JSON from stdin.

Convenience commands:

offerkit vouchers list
offerkit vouchers list --search SUMMER
offerkit vouchers get SUMMER10
offerkit vouchers create --code WAPP25 --campaign-id <CAMPAIGN_ID> --discount-amount 2500
offerkit vouchers update WAPP25 --data '{"redemptionLimit":1}'
offerkit vouchers bulk --campaign-id <CAMPAIGN_ID> --count 100 --discount-amount 2500
offerkit vouchers validate SUMMER10 --amount 9999 --currency USD
offerkit vouchers redeem SUMMER10 --amount 9999 --currency USD --idempotency-key order-42
offerkit vouchers qualify --data @qualify.json
offerkit vouchers stack-redeem --data @stack-redemption.json
offerkit campaigns list
offerkit campaigns get <CAMPAIGN_ID>
offerkit campaigns create --name "Spring 2026" --type DISCOUNT --currency USD --code-prefix SPRING
offerkit campaigns update <CAMPAIGN_ID> --status active --validation-rule-id <RULE_ID>
offerkit campaigns delete <CAMPAIGN_ID>
offerkit validation-rules list
offerkit validation-rules create \
  --name "Minimum spend" \
  --rule '{">=":[{"var":"order.amount"},25000]}'
offerkit validation-rules update <RULE_ID> --data '{"description":"EUR 250 minimum"}'
offerkit customers list
offerkit customers list --search alice
offerkit customers get 00000000-0000-0000-0000-000000000000
offerkit customers upsert --data '{"externalId":"user_123","email":"[email protected]"}'
offerkit segments list
offerkit promotions tiers create --data @tier.json
offerkit referrals issue --data @referral.json
offerkit loyalty members earn --data @earn-points.json
offerkit webhooks create --data @webhook.json
offerkit orders create --data @order.json
offerkit api-keys create --data '{"name":"CI","scopes":["*"]}'

Links

  • Repository: https://github.com/offerkit/offerkit
  • SDK package: https://www.npmjs.com/package/@offerkit/sdk
  • License: MIT