agent-stripe

Stripe incident triage CLI for AI agents

Language
Go
Version
0.18.0
License
PolyForm Perimeter 1.0.0
Category
CLI Tool

A read-heavy Stripe investigation CLI for AI agents: payments, invoices, subscriptions, disputes, refunds, balances, Connect transfers and payouts, checkout, catalog and pricing, Radar warnings — across both account namespaces, Connect v1 and Accounts v2 (UA2). Compact structured output, sensitive fields redacted by default, and no direct access to Stripe secrets.

Features

01

Both account namespaces — Connect v1 accounts and Accounts v2 / UA2, including v2 configurations, capabilities, requirement entries, persons and v2 core events

02

The /v2 transport handled for you — Bearer auth, its own API version, indexed array parameters and token pagination

03

Scenario investigations, not just endpoints — invoice payment evidence, checkout completion, card-last4 lookup, renewal summaries, collection risk, refund, dispute and fraud triage, ledger reconciliation, Connect money-movement failures and connected-account health

04

Redacted by default — sensitive values become [REDACTED] and the object carries an @redacted list naming each path and how to expose it

05

--expose is deliberate and scoped — comma-separated or repeated, applies to responses and debug bodies, and never reveals a stored profile key

06

Stripe context aware — Stripe-Context for organization keys and related-account requests, stored on the profile

07

Keychain-first credentials — API keys live in the keychain, never in config.json, and are never printed back

08

Only the credential type is stored as metadata — rk_test or sk_live, so auth list can tell you what a profile is without touching the secret

09

Bounded retries — 429s retry with exponential backoff and jitter, then return fixable_by: retry with Stripe's own rate-limit reason header

10

Debug without leaks — --debug emits client setup, credential source, request URLs, status codes, request IDs and redacted bodies, but never a raw key

11

Multi-profile — sandbox, live, organization and holding-account workflows side by side, selected with -p

12

GET-only raw API escape hatch for anything not yet wrapped

Install

Homebrew

>_
$ brew install shhac/tap/agent-stripe

AI Agent Skill

>_
$ npx skills add shhac/agent-skills --skill agent-stripe --global

GitHub Release (macOS)

>_
$ curl -L https://github.com/shhac/agent-stripe/releases/latest/download/agent-stripe-darwin-arm64.tar.gz | tar xz

Go Install

>_
$ go install github.com/shhac/agent-stripe/cmd/agent-stripe@latest

Build from Source

>_
$ git clone https://github.com/shhac/agent-stripe.git && cd agent-stripe && make build

Getting Started

agent-stripe needs a Stripe API key, stored in a named profile. When an LLM is guiding setup, prefer --form over --api-key: a native OS dialog asks the user for the key and the CLI returns only a redacted receipt.

01 · Add a profile without the key passing through chat

>_
$ agent-stripe auth add sandbox --form

Add --context acct_platform/acct_connected for an organization key or a related-account request; the context is stored as non-secret metadata on the profile.

02 · Check what the profile is

>_
$ agent-stripe auth check sandbox

Reports credential_type — rk_test, sk_live and so on. Rotate a key later with auth update <profile> --form, again without exposing it.

03 · Persist your defaults

>_
$ agent-stripe config set max_retries 3

max_retries and timeout_ms persist globally; command-line flags still override them.

04 · Start from recent events

>_
$ agent-stripe events list --type charge.failed --limit 20

Lists stream NDJSON. Every group has a usage page — payments usage, subscriptions usage, connect usage, investigate usage.

Usage

>_ Why did this invoice not get paid?
$ agent-stripe investigate invoice-payment in_...
>_ Find a customer's payment by card last4
$ agent-stripe investigate customer-card-payment --customer cus_... --last4 4242
>_ Who is at risk of not collecting
$ agent-stripe investigate collection-risk --days 30
>_ Health of a connected account
$ agent-stripe investigate account-health acct_...
>_ A PaymentIntent with its charge expanded
$ agent-stripe payment-intents get pi_... --expand latest_charge
>_ Open invoices on a subscription
$ agent-stripe subscriptions invoices sub_... --status open
>_ Radar early fraud warnings for a charge
$ agent-stripe early-fraud-warnings list --charge ch_...
>_ Expose one field, deliberately
$ agent-stripe payment-intents get pi_... --expose client_secret