Sign in
Create account
Sign in
Home
Payments
Business operations
Financial services
Developer tools
Security
All products
Home
Payments
Business operations
Home
Payments
Business operations
Financial services
Developer tools
Support
Overview
Quickstart
Stripe CLI
Listen to webhooks
Test and monitor your integration
Configure
Reference
Stripe for Visual Studio Code
Webhooks
File uploads
Error handling
Error codes
API
Keys
Libraries
Upgrades
Rate limits
Card testing
Expanding responses
Domains and IP addresses
Building With Stripe
Stripe.js and Elements
Prebuilt iOS UI
Prebuilt Android UI
Extensions
Plugins
Samples
Checklist
HomeDeveloper toolsStripe CLI

Configure the Stripe CLI

The Stripe CLI can handle less common use cases through several additional flags. The most important of these are highlighted below; use --help to see what else is possible.

Use an existing API key

By default, a new API key is generated for the Stripe CLI. To use an existing API key instead, add the --api-key flag:

Terminal
stripe login --api-key
sk_test_4eC39HqLyjWDarjtT1zdp7dc
Output
Your pairing code is: humour-nifty-finer-magic Press Enter to open up the browser (^C to quit)

Working with projects

Use the --project-name flag when you log in to configure different projects. You can then run commands with --project-name to use that configuration.

Terminal autocompletion

The Stripe CLI supports autocompletion for macOS and Linux to make it easier for you to use the right commands with the CLI.

Set up autocompletion by running stripe completion and, depending on your platform and shell, the relevant instructions are shown to you.

Setup with ZSH on macOS and Linux

Open a new ZSH shell and run the following commands:

Terminal
stripe completion mkdir -p ~/.stripe mv stripe-completion.zsh ~/.stripe

Add the following lines to your .zshrc file:

Terminal
# The next lines enables shell command completion for Stripe fpath=(~/.stripe $fpath) autoload -Uz compinit && compinit -i

See https://mads-hartmann.com/2017/08/06/writing-zsh-completion-scripts.html if you want to learn more about ZSH autocompletion scripts.

Was this page helpful?
Questions? Contact us.
Developer tutorials on YouTube.
You can unsubscribe at any time. Read our privacy policy.
On this page
Use an existing API key
Working with projects
Terminal autocompletion