Developer tools
Stripe CLI
Configure

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:

stripe login --api-key sk_test_4eC39HqLyjWDarjtT1zdp7dc
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:

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

Add the following lines to your .zshrc file:

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


Curious to learn more about ZSH autocompletion scripts? We recommend this blog post https://mads-hartmann.com/2017/08/06/writing-zsh-completion-scripts.html

Setup with Bash on macOS and Linux

Follow the instructions in https://sourabhbajaj.com/mac-setup/BashCompletion/ to set up Bash completions.

Open a new Bash shell and run the following commands:

stripe completion mkdir -p ~/.stripe mv stripe-completion.bash ~/.stripe

Add the following lines to your .bashrc file:

# The next line enables shell command completion for Stripe source ~/.stripe/stripe-completion.bash

Windows support

Windows is currently not supported.

Was this page helpful?
Questions? Contact us.
Developer tutorials on YouTube.