# Stripe CLI Documentation

This documentation covers the Stripe Command Line Interface (CLI), a powerful tool for developers to interact with Stripe services directly from their terminal.

## Table of Contents

* [Introduction and Overview](#introduction-and-overview)
* [Installation and Setup](#installation-and-setup)
* [Authentication and Configuration](#authentication-and-configuration)
* [Core Commands](#core-commands)
* [Resource Management](#resource-management)
* [Stripe Samples](#stripe-samples)
* [Additional Commands](#additional-commands)
* [Advanced Usage](#advanced-usage)
* [Troubleshooting and Support](#troubleshooting-and-support)
* [License](#license)

---

## Introduction and Overview

The Stripe CLI is a developer tool that helps you build, test, and manage your Stripe integration right from the terminal. It allows you to:

*   Create, retrieve, update, and delete API objects.
*   Tail API request logs in real time.
*   Securely test webhooks without relying on third-party tunneling software.

## Installation and Setup

*   **Installation Guide**: Follow the [installation guide](https://docs.stripe.com/stripe-cli.md#install) to set up the Stripe CLI on your system.

## Authentication and Configuration

The Stripe CLI offers several ways to manage your API keys and configurations:

*   **`stripe login`**: Connects the CLI to your Stripe account by persisting your secret key locally. This is the recommended way to get started.
    *   [Basic login](https://docs.stripe.com/cli/login.md#basic-login)
    *   [Login with project name](https://docs.stripe.com/cli/login.md#log-in-and-specify-a-project)
    *   [Interactive login](https://docs.stripe.com/cli/login.md#log-in-using-interactive-mode)
*   **`stripe config`**: Manually set configuration options for the CLI.
    *   [Setting options](https://docs.stripe.com/cli/config.md#set-a-configuration-option)
    *   [Unsetting options](https://docs.stripe.com/cli/config.md#unset-a-configuration-option)
    *   [Listing options](https://docs.stripe.com/cli/config.md#list-the-currently-configured-options)
    *   [Editing configuration file](https://docs.stripe.org/cli/config.md#edit)
*   **API Keys**: Understand the different ways to use Stripe API keys with the CLI, including `stripe login`, `stripe config`, the `--api-key` flag, and environment variables. [Using Stripe API keys](https://docs.stripe.com/cli/api_keys.md).
*   **`stripe logout`**: Removes credentials that connect the CLI to your Stripe account.
    *   [Basic logout](https://docs.stripe.com/cli/logout.md#basic-logout)
    *   [Logout of a specific project](https://docs.stripe.com/cli/logout.md#log-out-of-a-specific-project)
    *   [Logout of all projects](https://docs.stripe.com/cli/logout.md#log-out-of-all-projects)

## Core Commands

*   **`stripe help`**: Get help for any command in the CLI.
    *   [Basic usage](https://docs.stripe.com/cli/help.md#basic-usage)
*   **`stripe version`**: Get the version of the Stripe CLI and check for updates.
    *   [Basic usage](https://docs.stripe.com/cli/version.md#basic-usage)
*   **`stripe completion`**: Set up autocompletion for Bash and ZSH shells.
    *   [Basic usage](https://docs.stripe.com/cli/completion.md#basic-usage)
    *   [Specifying a shell](https://docs.stripe.com/cli/completion.md#specifying-a-shell)
*   **`stripe feedback`**: Provides information on how to give feedback for the Stripe CLI.
    *   [Basic usage](https://docs.stripe.com/cli/feedback.md#basic-usage)

## Resource Management

*   **Resources & HTTP commands**: The CLI supports managing API resources directly or via HTTP commands. [Resources & HTTP commands](https://docs.stripe.com/cli/intro_resources_http.md).
*   **`stripe resources`**: Interact with Stripe API resources using the CLI.
    *   [Listing supported operations](https://docs.stripe.com/cli/resources.md#listing-supported-operations)
    *   [Create a resource](https://docs.stripe.com/cli/resources.md#create-a-resource)
    *   [Update a resource](https://docs.stripe.com/cli/resources.md#update-a-resource)
    *   [Retrieve a resource](https://docs.stripe.com/cli/resources.md#retrieve-a-resource)
*   **`stripe fixtures`**: Use a JSON file to issue a series of API requests for generating sample data or testing API behavior.
    *   [Fixture file structure and querying](https://docs.stripe.com/cli/fixtures.md)

## Stripe Samples

Stripe Samples are complete examples that make it easy to get started with a new Stripe integration. The CLI allows you to download, build, and serve samples.

*   **`stripe samples create`**: Create a local copy of a sample.
    *   [Create a local copy of a sample](https://docs.stripe.com/cli/samples/create.md#create-a-local-copy-of-a-sample)
    *   [Specify a destination path](https://docs.stripe.com/cli/samples/create.md#specify-a-destination-path)
*   **`stripe samples list`**: List available Stripe Samples that can be created and bootstrapped by the CLI.
    *   [List available Stripe Samples](https://docs.stripe.com/cli/samples/list.md#list-available-stripe-samples)
*   **`stripe serve`**: Start an HTTP server to serve static files, useful for working with Stripe Samples.
    *   [Basic Usage](https://docs.stripe.com/cli/intro_stripe_samples.md#basic-usage)

## Additional Commands

*   **`stripe terminal quickstart`**: Get up and running fast with Stripe Terminal and the Verifone P400 reader.
    *   [Terminal quickstart](https://docs.stripe.com/cli/terminal/quickstart.md#terminal-quickstart)

## Advanced Usage

*   **Global Flags**: The Stripe CLI supports several flags that can be used with most commands.
    *   `--api-key`: Use a specific Stripe API secret key.
    *   `--color`: Enable or disable color output.
    *   `--config`: Specify a custom configuration file path.
    *   `--device-name`: Run a command on behalf of another device.
    *   `-h, --help`: Display help documentation.
    *   `--log-level`: Set the level of detail for log messages.
    *   `-p, --project-name`: Define a project name for the CLI's configuration.
    *   `-v, --version`: Print the CLI version.
    *   [Global Flags Reference](https://docs.stripe.com/cli/flags.md)
*   **Using with Docker**: Run the Stripe CLI in a Docker container.
    *   [Using with Docker](https://docs.stripe.com/cli/docker.md)
*   **Telemetry**: Understand the telemetry feature, what data is collected, why, and how to opt out.
    *   [Telemetry](https://docs.stripe.com/cli/telemetry.md)

## Troubleshooting and Support

*   **Reporting Bugs**: Use [GitHub issues](https://github.com/stripe/stripe-cli/issues) to report bugs or issues.
*   **Feature Requests**: Provide feedback on features you would like to see via the [CLI feedback form](https://stri.pe/cli-feedback).

## License

The Stripe CLI is licensed under the [Apache License 2.0](https://github.com/stripe/stripe-cli/blob/master/LICENSE).