Skip to content
Create account or Sign in
/
Ask AI
Create accountSign in
Get started
Payments
Revenue
Platforms and marketplaces
Money management
Developer resources
APIs & SDKsHelp
Overview
Versioning
Changelog
Upgrade your API version
Upgrade your SDK version
Essentials
SDKs
API
Testing
Stripe CLI
    Overview
    Install the CLI
    Use the CLI
    Stripe Projects
    Enable autocompletion
    CLI keys
    Trigger events
    Upgrade the CLI
    Browse docs in the terminal
    Manage your account in the terminal
Tools
Stripe Dashboard
Workbench
Developers Dashboard
Stripe for Visual Studio Code
Terraform
Stripe Discord server
Features
Workflows
Batch jobs
Event destinations
Stripe health alertsStripe SignalsFile uploads
AI solutions
Model Context ProtocolAgent skillsBuild agentic AI SaaS Billing workflowsStripe Directory
Extend Stripe
Overview
Build Stripe apps
Use apps from Stripe
Build extensions
Custom objects
Security and privacy
Security
Activity logsStripebot web crawler
Privacy
Partners
Partner ecosystem
Partner certification
United States
English (United States)
  1. Home/
  2. Developer resources/
  3. Stripe CLI

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.
Loading video content...

For more details, see the Stripe CLI reference.

Install the Stripe CLI

From the command line, use an install script or download and extract a versioned archive file for your operating system to install the CLI.

To install the Stripe CLI with npm, run:

Command Line
npm i -g @stripe/cli

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.

Command Line
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:

Command Line
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.

Command Line
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

  1. 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 Line
    stripe login
  2. Press Enter on your keyboard to complete the authentication process in your browser.

    Output
    Your 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.

Command Line
stripe login --interactive

You can also use the --api-key flag to specify your API secret key inline each time you send a request.

Command Line
stripe login --api-key
sk_test_BQokikJOvBiI2HlWgH4olfQ2
Was this page helpful?
YesNo
  • Need help? Contact Support.
  • Chat with Stripe developers on Discord.
  • Check out our changelog.
  • Questions? Contact Sales.
  • LLM? Read llms.txt.
  • Powered by Markdoc
On this page