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

@domdanao/magpie-cli

v1.0.3

Published

Command-line interface for the Magpie Payment Platform. Process payments, create checkout sessions, manage payment requests, and handle payment links from your terminal.

Readme

Magpie CLI

A command-line interface for the Magpie Payment Platform. Process payments, create checkout sessions, send invoices, and manage payment links — all from your terminal.

Installation

npm install -g @domdanao/magpie-cli

Or run directly with npx:

npx @domdanao/magpie-cli --help

Quick Start

1. Configure your API keys

magpie config set publicKey pk_live_xxxx
magpie config set secretKey sk_live_xxxx

Or use environment variables:

export MAGPIE_PUBLIC_KEY=pk_live_xxxx
export MAGPIE_SECRET_KEY=sk_live_xxxx

2. Start using the CLI

# List your checkout sessions
magpie checkout list

# Create a payment link
magpie link create \
  --name "Monthly Subscription" \
  --items '[{"name":"Pro Plan","quantity":1,"amount":49900}]' \
  --methods card,gcash,maya

# Check a charge status
magpie charge get chr_abc123

Commands

Configuration

magpie config set <key> <value>    # Store a config value
magpie config get <key>            # Read a config value
magpie config list                 # Show all config (secrets redacted)
magpie config profiles             # List all profiles
magpie config use <profile>        # Switch default profile
magpie config path                 # Show config file location

Payment Sources

# Create a card source
magpie source create -t card \
  --card-name "Juan Dela Cruz" \
  --card-number "4012001037141112" \
  --exp-month "12" --exp-year "2027" --cvc "123"

# Create a GCash source
magpie source create -t gcash \
  --success-url https://mysite.com/success \
  --fail-url https://mysite.com/fail

# Get source details
magpie source get src_xxxx

Customers

magpie customer create -e [email protected] -d "VIP Customer"
magpie customer get cus_xxxx
magpie customer find [email protected]
magpie customer update cus_xxxx -m "+639123456789"
magpie customer attach-source cus_xxxx src_xxxx
magpie customer detach-source cus_xxxx src_xxxx

Charges

# Create a charge (amount in cents: 5000 = PHP 50.00)
magpie charge create -a 5000 -s src_xxxx -d "Order #123" --statement "MYSHOP"

# List, capture, void, refund
magpie charge list
magpie charge capture chr_xxxx -a 5000
magpie charge void chr_xxxx
magpie charge refund chr_xxxx -a 2000    # Partial refund
magpie charge refund chr_xxxx            # Full refund

Checkout Sessions

magpie checkout create \
  --success-url https://mysite.com/success \
  --cancel-url https://mysite.com/cancel \
  --items '[{"name":"Premium Plan","quantity":1,"amount":99900}]' \
  --mode payment \
  --methods card,gcash,maya

magpie checkout list
magpie checkout get cs_xxxx
magpie checkout expire cs_xxxx
magpie checkout capture cs_xxxx

Payment Requests

magpie request create \
  --items '[{"name":"Web Design","quantity":1,"amount":250000}]' \
  --methods card,gcash \
  --deliver email

magpie request list --status open
magpie request get pr_xxxx
magpie request void pr_xxxx -r "Customer cancelled"
magpie request resend pr_xxxx

Payment Links

magpie link create \
  --name "T-Shirt Sale" \
  --items '[{"name":"T-Shirt","quantity":100,"amount":59900}]' \
  --methods card,gcash,paymaya

magpie link list --status active
magpie link get plink_xxxx
magpie link deactivate plink_xxxx
magpie link activate plink_xxxx

Global Options

| Flag | Description | |------|-------------| | --profile <name> | Use a specific configuration profile | | --test-mode | Enable test mode for the request | | --json | Output raw JSON (no colors, pipe-friendly) | | --compact | Output compact single-line JSON | | --verbose | Show detailed request/response info | | -V, --version | Show version number | | -h, --help | Show help |

Configuration

Profiles

Use profiles to manage multiple Magpie accounts (e.g. production and staging):

# Set up a staging profile
magpie config set publicKey pk_test_xxxx --profile staging
magpie config set secretKey sk_test_xxxx --profile staging

# Use staging for a single command
magpie checkout list --profile staging

# Switch default profile
magpie config use staging

Precedence

Configuration values are resolved in this order:

  1. CLI flags (e.g. --test-mode)
  2. Environment variables (MAGPIE_PUBLIC_KEY, MAGPIE_SECRET_KEY, etc.)
  3. Config file (~/.config/magpie-cli/config.json)

Piping & Scripting

The CLI is designed to be pipe-friendly:

# Get a checkout session URL
magpie checkout get cs_xxxx --json | jq '.url'

# List all paid payment requests as compact JSON
magpie request list --status paid --compact

# Use in shell scripts
CHARGE_ID=$(magpie charge create -a 5000 -s src_xxxx -d "Auto charge" --statement "AUTO" --json | jq -r '.id')
echo "Created charge: $CHARGE_ID"

Supported Payment Methods

| Method | Code | |--------|------| | Credit/Debit Card | card | | GCash | gcash | | Maya / PayMaya | maya, paymaya | | BPI | bpi | | Alipay | alipay | | UnionPay | unionpay | | WeChat Pay | wechat |

Not all payment methods are available on every API. See Magpie documentation for details.

License

MIT