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

@clink-ai/clink-cli

v0.1.2

Published

TypeScript CLI for Clink customer wallet APIs

Readme

clink-cli

clink-cli is a command-line client for Clink customer wallet APIs.

中文说明

Install

Install globally:

npm install -g @clink-ai/clink-cli

Run without installing globally:

npx @clink-ai/clink-cli --help

Published package name:

@clink-ai/clink-cli

Installed command:

clink-cli

Requirements:

  • Node.js >=20
  • Access to the target Clink API environment

Default base URL:

https://api.clinkbill.com

Quick Start

Every command starts with:

clink-cli <command> [subcommand] [options]

1. Initialize your wallet

Run this once to create or activate a customer wallet and save credentials locally:

clink-cli wallet init --email [email protected] --name "Alice"

Check the saved profile:

clink-cli wallet status --format pretty

The local config file is stored at:

~/.clink-cli/config.json

2. Open card pages

Get the raw binding link:

clink-cli card binding-link

Open the add-card page:

clink-cli card setup-link --open

Open the manage-card page:

clink-cli card modify-link --open

3. Check saved payment methods

List cached payment methods:

clink-cli card list --format pretty

Get one cached payment method:

clink-cli card get --payment-instrument-id pi_xxx

Notes:

  • card add/update/delete happens on the web page, not in the CLI
  • card list and card get read local cached data
  • card binding-link, card setup-link, and card modify-link refresh the local payment method cache

4. Make a payment

Pay with merchant mode:

clink-cli pay \
  --merchant-id merchant_xxx \
  --amount 10.00 \
  --currency USD \
  --payment-instrument-id pi_xxx

Pay with session mode:

clink-cli pay --session-id sess_xxx --payment-instrument-id pi_xxx

If --payment-instrument-id is omitted, pay uses the default cached payment method.

5. Refund an order

Create a full refund:

clink-cli refund create --order-id order_xxx

Check refund status:

clink-cli refund get --refund-id rfd_xxx

6. Check risk rules

Get current risk rule settings:

clink-cli risk-rule get --format pretty

Open the risk rule page:

clink-cli risk-rule link --open

Common Usage

Use a named profile:

clink-cli wallet init --profile buyer-2 --email [email protected] --name "Bob"
clink-cli wallet status --profile buyer-2 --format pretty

Override the base URL:

clink-cli wallet status --base-url https://api.clinkbill.com

Print requests without executing:

clink-cli pay \
  --merchant-id merchant_xxx \
  --amount 10.00 \
  --currency USD \
  --payment-instrument-id pi_xxx \
  --dry-run

Commands

Command groups:

  • clink-cli wallet init
  • clink-cli wallet status
  • clink-cli card binding-link
  • clink-cli card setup-link
  • clink-cli card modify-link
  • clink-cli card list
  • clink-cli card get --payment-instrument-id <id>
  • clink-cli risk-rule get
  • clink-cli risk-rule link
  • clink-cli pay --merchant-id <id> --amount <amount> --currency <currency>
  • clink-cli pay --session-id <id>
  • clink-cli refund create --order-id <id>
  • clink-cli refund get --refund-id <id>
  • clink-cli config set <key> <value>
  • clink-cli config get
  • clink-cli config unset <key>

Show help:

clink-cli --help
clink-cli wallet --help
clink-cli card --help
clink-cli refund --help

Configuration

Useful config commands:

clink-cli config get
clink-cli config set base-url https://api.clinkbill.com
clink-cli config set customer-id cus_xxx --profile buyer-2
clink-cli config set customer-api-key sk_xxx --profile buyer-2
clink-cli config set webhook-sign-key whsec_xxx --profile buyer-2
clink-cli config unset customer-api-key --profile buyer-2

Supported config keys:

  • base-url
  • customer-id
  • customer-api-key
  • webhook-sign-key
  • default-open-links
  • email
  • name

wallet init stores the webhook signing key on the selected profile. If --webhook-sign-key is omitted and the profile already has one, the CLI reuses that saved key; otherwise it generates a new 16-character alphanumeric key and persists it.

Resolution order:

  • command flags
  • environment variables
  • saved profile config

Environment variables:

  • CLINK_BASE_URL
  • CLINK_CUSTOMER_ID
  • CLINK_CUSTOMER_API_KEY

Global Options

  • --format <json|pretty>
  • --dry-run
  • --open
  • --profile <name>
  • --base-url <url>
  • --customer-id <id>
  • --customer-api-key <key>
  • --timeout <ms>
  • --help

Local Development

Build from source:

npm install
npm run build
node dist/index.js --help

Run tests:

npm test
npm run test:e2e