npm package: @ktmcp-cli/stripe-api
Description: Production-ready CLI for Stripe API - payments, customers, subscriptions
Author: KTMCP
Latest version: 1.0.0

![Banner](https://raw.githubusercontent.com/ktmcp-cli/stripe/main/banner.svg)

> "Six months ago, everyone was talking about MCPs. And I was like, screw MCPs. Every MCP would be better as a CLI."
>
> — [Peter Steinberger](https://twitter.com/steipete), Founder of OpenClaw
> [Watch on YouTube (~2:39:00)](https://www.youtube.com/@lexfridman) | [Lex Fridman Podcast #491](https://lexfridman.com/peter-steinberger/)

# Stripe API CLI

A production-ready command-line interface for the [Stripe API](https://stripe.com/docs/api). Manage payments, customers, subscriptions, invoices, and more — directly from your terminal.

> **Unofficial**: This project is not affiliated with or endorsed by Stripe, Inc.

---

## Features

- Full coverage of core Stripe resources: customers, charges, payment intents, subscriptions, invoices, refunds, products, prices
- Secure API key storage via OS keychain-backed config file
- Supports both `sk_live_` and `sk_test_` keys
- Spinner feedback for all API operations
- Clean tabular output for list commands
- Environment variable support (`STRIPE_SECRET_KEY`)
- Works with Node.js 18+

---

## Why CLI > MCP

| | CLI | MCP |
|---|---|---|
| Works everywhere | Yes | Requires MCP-compatible client |
| Shell scriptable | Yes | No |
| Pipeable output | Yes | No |
| Zero setup | Yes | Complex configuration |
| CI/CD friendly | Yes | No |
| Debuggable | Yes | Hard |

MCPs are wrappers. A CLI is a first-class tool.

---

## Installation

```bash
npm install -g @ktmcp-cli/stripe-api
```

Or use without installing:

```bash
npx @ktmcp-cli/stripe-api --help
```

---

## Authentication

Set your Stripe secret key once:

```bash
stripe-api config set --secret-key sk_test_your_key_here
```

Or use an environment variable:

```bash
export STRIPE_SECRET_KEY=sk_test_your_key_here
stripe-api customers list
```

Get your API keys at: https://dashboard.stripe.com/apikeys

---

## Commands

### Config

```bash
stripe-api config set --secret-key <key>   # Save API key
stripe-api config show                      # Show current config
stripe-api config clear                     # Clear config
```

### Customers

```bash
stripe-api customers list [--limit 10] [--email <email>]
stripe-api customers get <customer-id>
stripe-api customers create --email <email> --name <name>
stripe-api customers delete <customer-id>
```

### Charges

```bash
stripe-api charges list [--limit 10] [--customer <id>]
stripe-api charges get <charge-id>
```

### Payment Intents

```bash
stripe-api payment-intents list [--limit 10] [--customer <id>]
stripe-api payment-intents get <payment-intent-id>
stripe-api payment-intents create --amount <cents> --currency usd [--customer <id>]
stripe-api payment-intents cancel <payment-intent-id>
```

### Subscriptions

```bash
stripe-api subscriptions list [--customer <id>] [--status active]
stripe-api subscriptions get <subscription-id>
stripe-api subscriptions create --customer <id> --price <price-id>
stripe-api subscriptions cancel <subscription-id> [--at-period-end]
```

### Invoices

```bash
stripe-api invoices list [--customer <id>] [--status paid]
stripe-api invoices get <invoice-id>
stripe-api invoices pay <invoice-id>
```

### Refunds

```bash
stripe-api refunds list [--charge <id>]
stripe-api refunds get <refund-id>
stripe-api refunds create --charge <charge-id> [--amount <cents>]
```

### Products

```bash
stripe-api products list [--active]
stripe-api products get <product-id>
stripe-api products create --name <name>
```

### Prices

```bash
stripe-api prices list [--product <id>] [--active]
stripe-api prices get <price-id>
stripe-api prices create --product <id> --amount <cents> [--recurring-interval month]
```

---

## Examples

```bash
# List your 5 most recent customers
stripe-api customers list --limit 5

# Create a customer
stripe-api customers create --email alice@example.com --name "Alice Smith"

# Create a $29.99 payment intent
stripe-api payment-intents create --amount 2999 --currency usd

# List active subscriptions for a customer
stripe-api subscriptions list --customer cus_xxx --status active

# Issue a full refund
stripe-api refunds create --charge ch_xxx

# Issue a partial refund of $5.00
stripe-api refunds create --charge ch_xxx --amount 500

# List invoices for a customer
stripe-api invoices list --customer cus_xxx

# Create a recurring price ($19/month)
stripe-api prices create --product prod_xxx --amount 1900 --recurring-interval month

# Use with jq for scripting
stripe-api customers list --limit 100 | grep -E 'cus_|email'
```

---

## Environment Variables

| Variable | Description |
|----------|-------------|
| `STRIPE_SECRET_KEY` | Your Stripe secret key (`sk_live_...` or `sk_test_...`) |

---

## Resources

- [Stripe API Docs](https://stripe.com/docs/api)
- [Stripe Dashboard](https://dashboard.stripe.com)
- [KTMCP Project](https://killthemcp.com)

---

## License

MIT — see [LICENSE](LICENSE)

---

*Part of the [KTMCP](https://killthemcp.com) project — building CLIs as first-class alternatives to MCPs.*