@w3devx/stripe-cli
v0.0.1
Published
CLI tool for browsing Stripe data with local caching
Readme
xstripe
Read-only Stripe CLI for browsing account data with local caching, profile support, table/JSON/CSV output, and direct access to Stripe's Search API.
xstripe is built for developers who want a fast terminal workflow for inspecting Stripe resources without opening the dashboard for every lookup.
The npm package name is @w3devx/stripe-cli, and the installed executable is xstripe.
Features
- Read-only Stripe data browser
- Local response caching for faster repeat queries
- Multiple profiles for test/live or multiple Stripe accounts
- Table, JSON, and CSV output
- Stripe Search API support for supported resources
- Raw authenticated API requests for endpoints outside the built-in modules
- Expand support for nested Stripe objects
Supported Resources
customerschargespayment-intentssubscriptionsinvoicesproductspricespayment-methodsbalanceeventsrefundsdisputespayouts
Short aliases are also available, for example cust, ch, pi, sub, inv, prod, pr, pm, bal, ev, ref, dis, and po.
Installation
xstripe is a Bun-based CLI published as @w3devx/stripe-cli. Users need bun installed and available on their PATH.
npm install -g @w3devx/stripe-cliVerify the install after global installation:
xstripe --versionAfter installation, run the CLI as xstripe.
If you are using it from source instead of the npm registry:
bun install
bun run src/index.ts --helpQuick Start
- Get a Stripe secret key from
https://dashboard.stripe.com/apikeys - Run the setup wizard:
xstripe auth setup- Browse data:
xstripe customers
xstripe charges
xstripe balanceAuthentication
xstripe stores credentials per profile under ~/.xstripe/profiles/<name>/auth.json.
- Accepted key prefixes:
sk_test_,sk_live_,rk_test_,rk_live_ - File permissions are set to
0600 - Authentication is validated against
GET /v1/balanceduring setup when possible
Useful commands:
xstripe auth setup
xstripe auth status
xstripe auth clearCommon Usage
List records:
xstripe customers
xstripe charges --limit 20
xstripe subscriptions --status activeGet a single record by ID:
xstripe cust cus_123
xstripe pi pi_123
xstripe invoices in_123Filter by date:
xstripe charges --from 2026-01-01 --to 2026-03-31Expand nested Stripe objects:
xstripe payment-intents pi_123 --expand customer --expand latest_chargeChoose output format:
xstripe customers --table
xstripe customers --json
xstripe customers --csvSearch API
For searchable Stripe resources, xstripe supports Stripe's Search API:
xstripe search customers --query "email:'[email protected]'"
xstripe search charges --query "amount>5000 AND status:'succeeded'"
xstripe search invoices --query "customer:'cus_123'" --limit 10Searchable resources:
customerschargespayment-intentssubscriptionsinvoicesproductsprices
Raw API Access
Use raw when you want to hit Stripe endpoints that do not have a dedicated module yet.
xstripe raw /customers
xstripe raw /customers --param limit=5
xstripe raw /charges/ch_123 --json
xstripe raw /balanceSupported methods today:
GETPOST
Profiles
Profiles let you separate credentials and preferences for different Stripe accounts or modes.
xstripe profile list
xstripe profile create live
xstripe profile use live
xstripe profile show
xstripe customers --profile defaultProfile resolution order:
--profile <name>XSTRIPE_PROFILE- default profile from
~/.xstripe/config.json default
Configuration
Per-profile settings:
outputFormat:table,json,csvcacheTtl: cache TTL in seconds
Examples:
xstripe config show
xstripe config set outputFormat json
xstripe config set cacheTtl 7200Caching
API responses are cached under ~/.xstripe/cache/<profile>/<module>/.
Useful flags:
--refreshto bypass cache and refresh it--no-cacheto skip cache entirely
Cache commands:
xstripe cache stats
xstripe cache clear
xstripe cache clear customers
xstripe cache clear --allBalance Commands
balance is a special command:
xstripe balance
xstripe balance transactions
xstripe balance transactions txn_123Global Flags
Available on the CLI root:
-h,--help-V,--version-v,--verbose-q,--quiet
Available on most data commands:
--json--csv--table--refresh--no-cache--from <date>--to <date>--limit <n>--expand <field>--filter k=v--profile <name>
Data Directory
xstripe stores all local state in:
~/.xstripe/
config.json
profiles/<name>/auth.json
profiles/<name>/config.json
cache/<name>/<module>/Development
bun install
bun run src/index.ts --help
bun run dev
bun run buildPackage scripts:
bun run startbun run devbun run buildbun run linkbun run unlinkbun test
Notes
- This CLI is intentionally read-only for built-in resource commands.
- It uses Stripe's REST API directly at
https://api.stripe.com/v1. - Search behavior depends on Stripe's Search API support for each resource.
License
MIT
