Install the Stripe CLI
Install the Stripe CLI on macOS, Windows, or Linux.
The Stripe CLI lets you build, test, and manage your integration from the command line. You can use the Stripe CLI to:
- Register and get test API keys directly from the terminal, without signing up in a browser.
- Create, retrieve, update, or delete any of your Stripe resources in a sandbox.
- Stream real-time API requests and events happening in your account.
- Trigger events to test your webhooks integration.
For more details, see the Stripe CLI reference.
Install the Stripe CLI
If you have Node.js 18 or later installed, you can install the Stripe CLI with npm:
npm install -g @stripe/cli
You can also run commands directly with npx, although this won’t add stripe to your PATH:
npx @stripe/cli login
For additional installation options on Windows, macOS, Linux, and Docker, check the Stripe CLI readme on GitHub.
Get started without an account
The sandbox create command provisions a new sandbox with working test API keys, without requiring an account. This enables you, a coding agent, or an automated workflow to start building a Stripe integration immediately.
stripe sandbox create --email you@example.com
Note
Use --from-git instead of --email <email> to infer the email from your Git config. Agents and automated scripts should add --non-interactive to print output without waiting for input.
This returns a sandbox with working test API keys:
Setting up your sandbox... done. { "secret_key": "rkcs_test_abc123", "publishable_key": "pk_test_def456", "claim_url": "https://dashboard.stripe.com/onboard_sandbox/0000000...", "account_id": "acct_ghi789", "expires_at": "2026-06-22" }
Your temporary sandbox credentials are saved to your CLI profile so that other commands work without needing to log in.
Sandboxes expire after 7 days. You can convert a sandbox into a full Stripe account with the sandbox claim command.
stripe sandbox claim
If you’re already logged in, sandbox create opens the sandbox management page in your Stripe Dashboard.
Log in to the CLI
Log in and authenticate your Stripe user account to generate a set of restricted keys. To learn more, see Stripe CLI keys and permissions.
Command Linestripe loginPress Enter on your keyboard to complete the authentication process in your browser.
OutputYour pairing code is: enjoy-enough-outwit-win This pairing code verifies your authentication with Stripe. Press Enter to open the browser or visit https://dashboard.stripe.com/stripecli/confirm_auth?t=THQdJfL3x12udFkNorJL8OF1iFlN8Az1 (^C to quit)
Optionally, if you don’t want to use a browser, use the --interactive flag to authenticate with an existing API secret key or restricted key. This is helpful when authenticating to the CLI without a browser, such as in a CI/CD pipeline.
stripe login --interactive
You can also use the --api-key flag to specify your API secret key inline each time you send a request.
stripe login --api-keysk_test_BQokikJOvBiI2HlWgH4olfQ2
Upgrade the Stripe CLI
Keep your Stripe CLI up to date to access new features, improvements, and security updates.
To upgrade the Stripe CLI with npm, run:
npm update -g @stripe/cli
For additional upgrade options on Windows, macOS, Linux, and Docker, check the Stripe CLI readme on GitHub.