Skip to content

Stripe CLI

1.9k stars
official open-source Has MCP macOS Linux Windows Cross-platform Actively maintained

Stripe's official command-line tool. Build, test, and manage payment integrations with webhook forwarding, event triggering, and real-time API log tailing from the terminal.

Stripe CLI has both a CLI and an MCP server. See when to use each

Part of the Stripe CLI tools for AI agents

What your agent can do

Before `stripe listen`, testing webhooks required: deploy your handler to a public URL, configure the endpoint in the Stripe dashboard, trigger a test event, check your server logs, find the bug, redeploy, repeat. Each iteration took 3-5 minutes. Your agent runs `stripe listen --forward-to localhost:3000/webhook` and creates a direct tunnel from Stripe's event system to your local server. No ngrok, no public URL, no deployment.Your agent runs `stripe trigger payment_intent.succeeded` to simulate the entire payment lifecycle locally in seconds. Combined with `stripe listen`, this creates the tightest possible development loop: trigger an event, watch it hit your local handler, debug the response, iterate. Your agent can chain these commands to test complex flows like subscription creation, invoice finalization, and payment failure recovery.Real-time API monitoring happens through `stripe logs tail`. Your agent filters by status code to catch 400s and 500s as they happen. Customer reports a failed charge? Your agent runs `stripe logs tail --filter-status-code 402` and gets the exact API call that failed, the error code, and the request payload. No dashboard digging, no cross-referencing event logs with server logs.Your agent manages Stripe resources directly. `stripe customers create`, `stripe subscriptions list`, `stripe payment_intents retrieve pi_xxxxx`. For testing and development, this is faster than writing throwaway SDK scripts.One gotcha your agent handles automatically: `stripe listen` generates a temporary webhook signing secret (starts with `whsec_`) that differs from your dashboard secret. If your code hardcodes the dashboard secret, local testing silently fails. Events arrive but signature verification rejects them. Experienced developers use the `STRIPE_WEBHOOK_SECRET` environment variable and swap between local and production. This trips up every developer at least once.Stripe also provides an official MCP server (`@stripe/mcp`) and detects AI agent environments automatically, appending agent info to API request headers.

Limitations

Stripe Connect webhook events cannot be tested with `stripe listen`, which frustrates marketplace and platform developers. The CLI is a development tool, not a production monitoring solution. Dashboard-specific features like revenue charts, dispute management, and payout scheduling have no CLI equivalent. Stripe-only, with no cross-platform payment processor support.

Key Commands

stripe listen Forward webhook events to a local endpoint for development testing
stripe trigger Trigger a specific webhook event for testing without real transactions
stripe logs tail Tail API request logs in real time from your Stripe account
stripe events resend Resend a previously delivered webhook event for debugging
stripe login Authenticate the CLI with your Stripe account via browser
stripe resources Interact with Stripe API resources directly from the terminal
stripe samples Clone and bootstrap Stripe sample integration projects

GitHub Stats

repo stripe/stripe-cli
stars 1.9k
language Go
license Apache-2.0
last commit Mar 11, 2026

Alternatives

tool description
Stripe CLI current tool
Stripe Dashboard Stripe's web-based interface for managing payments, viewing logs, and configuring webhooks. Provides visual tools the CLI does not replicate.
Mollie CLI Command-line interface for the Mollie payment API. Targets a different payment platform but fills a similar CLI-for-payments niche.

FAQ

Is the Stripe CLI free?
Yes. The Stripe CLI is free and open-source under the Apache 2.0 license with 4,800+ stars. It works with all Stripe accounts including free test-mode accounts. You pay Stripe's transaction fees on live payments, not for the CLI. Setup requires only a `stripe login` authentication step.
How do you test webhooks locally with the Stripe CLI?
Run `stripe listen --forward-to localhost:3000/webhooks` to forward events to your local server. The CLI creates a temporary webhook endpoint on Stripe's side and tunnels events to your machine. Fire `stripe trigger payment_intent.succeeded` to generate specific events. No ngrok or external tunneling required. Your agent handles the entire test loop.
Can AI coding agents use the Stripe CLI?
Yes. Stripe provides an official MCP server (`@stripe/mcp` on npm) that exposes API operations and documentation search to agents. The CLI itself works with any agent that can run shell commands. Stripe detects AI agent environments automatically and appends agent info to API request headers for observability.
What is the difference between stripe listen and stripe trigger?
`stripe listen` opens a persistent connection forwarding incoming webhook events to a local URL. `stripe trigger` creates specific test events on demand. Use them together: run `listen` in one terminal to receive events, run `trigger` in another to generate them. Your agent orchestrates both for a complete local webhook testing loop.

Last verified: Mar 14, 2026