stripe
Concatenate files by line
TLDR
Follow the logs of activity on the account
Listen for events, filtering on events with the name charge.succeeded and forwarding them to localhost:3000/events
Send a test webhook event
Create a customer
Print to JSON
SYNOPSIS
stripe command [options] [arguments]
PARAMETERS
--api-key
Uses a specific secret API key for the command. This overrides any key set via environment variables or configuration.
--config
Specifies a custom path to the configuration file, overriding the default location (e.g., `~/.config/stripe/config.toml`).
--color
Controls the color output of the CLI. Accepted modes are 'auto' (default), 'always', and 'never'.
--log-level
Sets the verbosity of logging output. Valid levels include 'debug', 'info', 'warn', and 'error'.
--no-version-check
Disables the automatic check for new CLI versions on startup.
--project-name
Assigns a specific project name, useful for managing multiple Stripe projects or configurations.
--skip-update
Skips the automatic update process that runs when the CLI starts.
--version, -v
Prints the current version of the Stripe CLI and then exits.
--help, -h
Displays a help message for the main command or a specific subcommand.
DESCRIPTION
The Stripe CLI is a powerful command-line interface developed by Stripe Inc., designed to facilitate developer interaction with the Stripe API and account directly from the terminal. It provides essential functionalities for building and debugging Stripe integrations locally. Key features include the ability to trigger webhook events for development and testing purposes, tail real-time logs from API requests, and manage various Stripe resources like customers, payments, and products without needing to access the Stripe Dashboard or write extensive code. This tool is instrumental in streamlining the development workflow, enabling rapid prototyping, and efficient debugging of applications built on the Stripe platform. It simulates production environments effectively, offering immediate feedback on API calls and event handling.
CAVEATS
The Stripe CLI requires an active Stripe account and a working internet connection to interact with the Stripe API. For full functionality, especially for local webhook testing, you might need additional tools like `ngrok` or similar tunneling services. Proper authentication is crucial, typically achieved via `stripe login` or by providing an API key. It's highly recommended to use test mode API keys during development and only use live mode keys when absolutely necessary and with extreme caution.
SUBCOMMANDS
The stripe command serves as a dispatcher for a multitude of subcommands, each addressing a specific category of tasks or resources. Examples include stripe listen for forwarding webhook events to your local machine, stripe logs tail for real-time streaming of API request logs, and various subcommands under stripe customers, stripe payments, stripe products, etc., for managing these respective resources. Each subcommand has its own specific set of options and arguments, which can be explored by running stripe subcommand --help.
AUTHENTICATION
To use the Stripe CLI, you must authenticate it with your Stripe account. The most common and recommended method is to run stripe login, which initiates an OAuth flow in your web browser to grant the CLI access. Alternatively, you can provide your secret API key directly using the --api-key flag or by setting the `STRIPE_API_KEY` environment variable. It's crucial to differentiate between publishable and secret keys, and always use your secret key when authenticating the CLI.
HISTORY
The Stripe CLI was developed by Stripe Inc. to streamline the developer experience when building integrations with their platform. Its inception was driven by the need to simplify local testing of webhooks – a critical component of many Stripe applications that was historically difficult to test without deploying code to a public endpoint. Over time, it expanded to encompass a wide range of functionalities, including API request logging, resource management, and more, establishing itself as an indispensable tool for the Stripe developer community.