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.
Stripe CLI is available for macOS, Windows, and Linux for distros like Ubuntu, Debian, RedHat and CentOS.
Stripe CLI is available on macOS via Homebrew:
brew install stripe/stripe-cli/stripe
Refer to the installation instructions for available Linux installation options.
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
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)
Passwod Store Setup on Linux Dockers
- Create
entrypoint.sh
#!/bin/sh
if ! [ -f ~/.gnupg/trustdb.gpg ] ; then
chmod 700 ~/.gnupg/
gpg --quick-generate-key <gpg-key-alias-name> # ie. gpg --quick-generate-key stripe-live
fi
if ! [ -f ~/.password-store/.gpg-id ] ; then
pass init <gpg-key-alias-name> # ie. pass init stripe-live
fi
string="$@"
liveflag="--live"
if [ -z "${string##*$liveflag*}" ] ;then
pass show default.live_mode_api_key >/dev/null
fi
/bin/stripe $@
- Create 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" ]
- Build docker image
docker build -t stripe-cli -f Dockerfile-cli .
- Run docker image with pass volumes
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 more details on initializing password store with gpg key, see https://gist.github.com/flbuddymooreiv/a4f24da7e0c3552942ff
Instructions are also available for installing and using the CLI without a package manager.
Installing the CLI provides access to the stripe
command.
stripe [command]
# Run `--help` for detailed information about CLI commands
stripe [command] help
The Stripe CLI supports a broad range of commands. Below are some of the most used ones:
login
listen
trigger
logs tail
events resend
samples
serve
status
config
open
get
,post
&delete
commandsresource
commands
For a full reference, see the CLI reference site
The Stripe CLI includes a telemetry feature that collects some usage data. See our telemetry reference for details.
Got feedback for us? Please don't hesitate to tell us on feedback.
See Developing the Stripe CLI for more info on how to make contributions to this project.
Copyright (c) Stripe. All rights reserved.
Licensed under the Apache License 2.0 license.