# 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. [Watch on YouTube](https://www.youtube.com/watch?v=iFwBGI-kqeE) For more details, see the [Stripe CLI reference](https://docs.stripe.com/cli.md). ## Install the Stripe CLI If you have Node.js 18 or later installed, you can install the Stripe CLI with [npm](https://www.npmjs.com/): ```bash npm install -g @stripe/cli ``` You can also run commands directly with `npx`, although this won’t add `stripe` to your `PATH`: ```bash npx @stripe/cli login ``` For additional installation options on Windows, macOS, Linux, and Docker, check the [Stripe CLI readme](https://github.com/stripe/stripe-cli#installation) 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. ```bash stripe sandbox create --email you@example.com ``` > Use `--from-git` instead of `--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: ```bash 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. ```bash stripe sandbox claim ``` If you’re already [logged in](https://docs.stripe.com/cli/login), `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](https://docs.stripe.com/get-started/account/set-up.md) to generate a set of restricted keys. To learn more, see [Stripe CLI keys and permissions](https://docs.stripe.com/stripe-cli/keys.md). ```bash stripe login ``` 2. Press **Enter** on your keyboard to complete the authentication process in your browser. ```bash 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. ```bash stripe login --interactive ``` You can also use the `--api-key` flag to specify your API secret key inline each time you send a request. ```bash stripe login --api-key <> ``` ## 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](https://www.npmjs.com/), run: ```bash npm update -g @stripe/cli ``` For additional upgrade options on Windows, macOS, Linux, and Docker, check the [Stripe CLI readme](https://github.com/stripe/stripe-cli#upgrading) on GitHub.