stripe-cli

module
v1.40.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: Apache-2.0

README

Stripe CLI

GitHub release (latest by date) Build Status

The Stripe CLI helps you build, test, and manage your Stripe integration right from the terminal.

With the CLI, you can:

  • Securely test webhooks without relying on 3rd party software
  • Trigger webhook events or resend events for easy testing
  • Tail your API request logs in real-time
  • Create, retrieve, update, or delete API objects.

demo

Installation

Stripe CLI is available for macOS, Windows, and Linux for distros like Ubuntu, Debian, RedHat and CentOS.

macOS

Stripe CLI is available on macOS via Homebrew:

brew install stripe/stripe-cli/stripe
Linux

Refer to the installation instructions for available Linux installation options.

Windows

Stripe CLI is available on Windows via the Scoop package manager:

scoop bucket add stripe https://github.com/stripe/scoop-stripe-cli.git
scoop install stripe
Docker

The CLI is also available as a Docker image: stripe/stripe-cli.

docker run --rm -it stripe/stripe-cli version
stripe version x.y.z (beta)

Password Store Setup with Docker

While test mode doesn’t require password store, you will need to set it up if you wish to perform live mode requests.

You can also make live mode requests on a per command basis by attaching the --api-key flag.

  1. Create entrypoint.sh
#!/bin/sh
if ! [ -f ~/.gnupg/trustdb.gpg ] ; then
  chmod 700 ~/.gnupg/
  gpg --quick-generate-key stripe-live # This will generate a gpg key called "stripe-live"
fi
if ! [ -f ~/.password-store/.gpg-id ] ; then
  pass init stripe-live # This will initialize a password store record named "stripe-live", using the gpg key above
  pass insert stripe-live # This will insert value for the password store "stripe-live", which we will put Stripe Live Secret Key in
fi

string="$@"
liveflag="--live"

if [ -z "${string##*$liveflag*}" ] ;then
  OPTS="--api-key $(pass show stripe-live)" # This will use the content of the password store "stripe-live" which was inserted in line 8
fi

#pass insert stripe-live
/bin/stripe  $@ $OPTS
  1. Create a docker file Dockerfile-cli
FROM  stripe/stripe-cli:vx.x.x
RUN  apk  add  pass  gpg-agent
COPY  ./entrypoint.sh  /entrypoint.sh
ENTRYPOINT  [ "/entrypoint.sh" ]
  1. Build the docker image
docker build -t stripe-cli -f Dockerfile-cli .
  1. Run the docker image with password volumes, replacing $command with the appropraite Stripe CLI command (i.e customers list)
docker run --rm -it -v stripe-config://root/.config/stripe/ -v stripe-gpg://root/.gnupg/ -v stripe-pass://root/.password-store/ stripe-cli $command

For live mode requests append --live after $command.

Without package managers

Instructions are also available for installing and using the CLI without a package manager.

Usage

Installing the CLI provides access to the stripe command.

stripe [command]

# Run `--help` for detailed information about CLI commands
stripe [command] help

Commands

The Stripe CLI supports a broad range of commands. Below are some of the most used ones:

Documentation

For a full reference, see the CLI reference site

Telemetry

The Stripe CLI includes a telemetry feature that collects some usage data. See our telemetry reference for details.

Feedback

Got feedback for us? Please don't hesitate to tell us on feedback.

Contributing

See Developing the Stripe CLI for more info on how to make contributions to this project.

License

Copyright (c) Stripe. All rights reserved.

Licensed under the Apache License 2.0 license.

Directories

Path Synopsis
canary
testutil
Package testutil provides utilities for running canary tests against the compiled Stripe CLI binary.
Package testutil provides utilities for running canary tests against the compiled Stripe CLI binary.
cmd
stripe command
pkg
ansi
Package ansi provides helpers for terminal color and formatting.
Package ansi provides helpers for terminal color and formatting.
cmd
Package cmd implements all Stripe CLI commands.
Package cmd implements all Stripe CLI commands.
cmd/logs
Package logs provides the logs tail command.
Package logs provides the logs tail command.
cmd/plugin
Package plugin provides plugin management commands.
Package plugin provides plugin management commands.
cmd/pluginhints
Package pluginhints provides placeholder Cobra commands for known plugins that are not yet installed, guiding users to install or request access.
Package pluginhints provides placeholder Cobra commands for known plugins that are not yet installed, guiding users to install or request access.
cmd/resource
Package resource provides auto-generated API resource commands.
Package resource provides auto-generated API resource commands.
cmd/samples
Package samples provides CLI commands for managing Stripe samples.
Package samples provides CLI commands for managing Stripe samples.
config
Package config manages CLI configuration and profiles.
Package config manages CLI configuration and profiles.
fixtures
Package fixtures provides declarative test data creation via fixture files.
Package fixtures provides declarative test data creation via fixture files.
gen
Package gen provides code generation from OpenAPI specs.
Package gen provides code generation from OpenAPI specs.
git
Package git provides Git integration for the Stripe CLI.
Package git provides Git integration for the Stripe CLI.
login
Package login implements Stripe authentication flows.
Package login implements Stripe authentication flows.
login/acct
Package acct provides Stripe account retrieval during login.
Package acct provides Stripe account retrieval during login.
login/keys
Package keys handles API key retrieval and configuration during login.
Package keys handles API key retrieval and configuration during login.
logout
Package logout handles clearing stored Stripe credentials.
Package logout handles clearing stored Stripe credentials.
logtailing
Package logtailing provides real-time API log streaming.
Package logtailing provides real-time API log streaming.
open
Package open provides utilities for opening URLs in a browser.
Package open provides utilities for opening URLs in a browser.
parsers
Package parsers provides query and fixture data parsing utilities.
Package parsers provides query and fixture data parsing utilities.
plugins
Package plugins provides the plugin system for extending the CLI.
Package plugins provides the plugin system for extending the CLI.
proxy
Package proxy forwards webhook events to local endpoints.
Package proxy forwards webhook events to local endpoints.
requests
Package requests builds and executes Stripe API requests.
Package requests builds and executes Stripe API requests.
rpcservice
Package rpcservice implements the gRPC server for CLI integrations.
Package rpcservice implements the gRPC server for CLI integrations.
samples
Package samples manages Stripe sample application setup.
Package samples manages Stripe sample application setup.
spec
Package spec provides OpenAPI specification parsing.
Package spec provides OpenAPI specification parsing.
status
Package status provides Stripe API status page integration.
Package status provides Stripe API status page integration.
stripe
Package stripe provides the HTTP client for the Stripe API.
Package stripe provides the HTTP client for the Stripe API.
stripeauth
Package stripeauth handles Stripe session authorization.
Package stripeauth handles Stripe session authorization.
terminal
Package terminal provides commands for managing Stripe Terminal readers.
Package terminal provides commands for managing Stripe Terminal readers.
terminal/p400
Package p400 provides support for Stripe Terminal P400 readers.
Package p400 provides support for Stripe Terminal P400 readers.
useragent
Package useragent builds User-Agent strings for Stripe API requests.
Package useragent builds User-Agent strings for Stripe API requests.
validators
Package validators provides input validation for CLI commands.
Package validators provides input validation for CLI commands.
version
Package version manages CLI version checking and display.
Package version manages CLI version checking and display.
websocket
Package websocket provides the WebSocket client for Stripe event streaming.
Package websocket provides the WebSocket client for Stripe event streaming.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL