The Stripe CLI helps you build, test, and manage your Stripe integration right from the terminal.
Stripe CLI is a command-line tool designed to facilitate the development, testing, and management of Stripe integrations directly from your terminal. This powerful utility empowers developers and teams by streamlining integration processes with essential features.
Key Features:
Secure Webhook Testing: Enables developers to test webhooks without relying on third-party software, ensuring secure and reliable functionality.
Event Management: Allows triggering or resending events for easier testing and debugging within your application.
Real-Time Logging: Provides the ability to monitor API request logs in real-time, enhancing visibility into integration performance.
API Object Management: Simplifies creating, retrieving, updating, or deleting API objects, streamlining workflow efficiency.
Audience & Benefit:
Ideal for developers and teams integrating Stripe into their applications, Stripe CLI accelerates development cycles by offering efficient testing, debugging, and management capabilities. It eliminates the need for additional tools, allowing seamless integration directly from the terminal, thus enhancing productivity and reducing complexity in managing Stripe integrations.
README
Stripe CLI
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.
Installation
Stripe CLI is available for macOS, Windows, and Linux for distros like Ubuntu, Debian, RedHat and CentOS.
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.
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