@usefin/plugin-stripe
v0.1.0
Published
Stripe provider plugin for fin CLI
Downloads
115
Readme
@usefin/plugin-stripe
Stripe provider plugin for the fin CLI (supported). List, get, create, update, delete using the shared command grammar; use --data '{"key":"value"}' for create/update. When authenticated, real Stripe API is used; mock fallback when not.
Installation
The plugin is included when you install the main usefin CLI. To use it as a dependency:
pnpm add @usefin/plugin-stripe @usefin/cliOr from the monorepo: the core package already lists @usefin/plugin-stripe in oclif.plugins.
Auth setup
Stripe uses API key authentication.
- Create a Stripe API key (secret key, e.g.
sk_live_...orsk_test_...). - Log in with fin:
usefin auth:login stripe --api-key sk_test_...
# or interactively
usefin auth:login stripe --interactiveCredentials are stored securely (keytar when available, otherwise encrypted file). Check status:
usefin auth:status
usefin doctorUsage
All commands support --json, --csv, --jsonl, --filter, --limit, --interactive, --dry-run, --audit, and --verbose.
List commands
| Command | Example |
|--------|---------|
| stripe:customers:list | usefin stripe:customers:list --status active --limit 10 |
| stripe:charges:list | usefin stripe:charges:list --status succeeded |
| stripe:invoices:list | usefin stripe:invoices:list --status open --json |
| stripe:subscriptions:list | usefin stripe:subscriptions:list --status active |
| stripe:payments:list | usefin stripe:payments:list |
| stripe:payment-methods:list | usefin stripe:payment-methods:list |
| stripe:refunds:list | usefin stripe:refunds:list |
| stripe:disputes:list | usefin stripe:disputes:list |
| stripe:payouts:list | usefin stripe:payouts:list |
| stripe:products:list | usefin stripe:products:list |
| stripe:prices:list | usefin stripe:prices:list |
| stripe:balance-transactions:list | usefin stripe:balance-transactions:list |
| stripe:coupons:list | usefin stripe:coupons:list |
| stripe:checkout-sessions:list | usefin stripe:checkout-sessions:list |
| stripe:webhook-endpoints:list | usefin stripe:webhook-endpoints:list |
Get commands
| Command | Example |
|--------|---------|
| stripe:customers:get <id> | usefin stripe:customers:get cus_xxx --json |
| stripe:charges:get <id> | usefin stripe:charges:get ch_xxx |
| stripe:invoices:get <id> | usefin stripe:invoices:get inv_xxx |
| stripe:subscriptions:get <id> | usefin stripe:subscriptions:get sub_xxx |
| stripe:payments:get <id> | usefin stripe:payments:get pi_xxx |
| (same pattern for other objects) | usefin stripe:<object>:get <id> |
Create, update, delete
Use --data with a JSON body for create and update. Examples:
| Verb | Example |
|------|---------|
| create | usefin stripe:customers:create --data '{"email":"[email protected]"}' |
| update | usefin stripe:customers:update cus_xxx --data '{"email":"[email protected]"}' |
| delete | usefin stripe:customers:delete cus_xxx |
The --data flag is required for create and update. When not authenticated, list/get use mock data. When authenticated, commands call the Stripe API.
