## Stripe CLI Documentation

This documentation covers the Stripe Command Line Interface (CLI), a powerful tool for developers to build, test, and manage their Stripe integrations directly from the terminal.

### Core Functionality

*   **`stripe login`**: Connect the CLI to your Stripe account by logging in to persist your secret key locally. This command facilitates authentication by redirecting you to the Stripe Dashboard. Project-specific configurations can be managed using the `--project-name` flag, and interactive login is available via the `--interactive` flag.
*   **`stripe logout`**: Remove credentials that connect the CLI to your Stripe account. This command can be used to log out of the default project, a specific project using `--project-name`, or all projects using the `-a` or `--all` flag.
*   **`stripe config`**: Manually set or unset configuration options for the CLI. This command allows for fine-grained control over CLI behavior, including setting API keys, device names, and color output. The `--edit` flag opens the configuration file in your default editor, and `--list` displays all configured options.
*   **`stripe api_keys`**: Understand the different methods for using Stripe API keys with the CLI, including `stripe login`, `stripe config`, the `--api-key` flag, and environment variables.
*   **`stripe resources`**: Interact with Stripe API resources directly from the CLI. This command allows you to create, retrieve, update, and delete API objects. You can view available operations for a specific resource by using `stripe {resource} --help`.
*   **`stripe fixtures`**: Use JSON files to issue a series of API requests, useful for generating sample data, executing specific flows, or testing API behavior. Responses can be referenced in subsequent requests using a specific syntax.

### Managing Samples and Development

*   **`stripe samples`**:
    *   **`create`**: Download, build, and serve Stripe Samples to a local directory. You can specify the sample name and a destination path. The `--force-refresh` flag can be used to refresh the cached list of samples.
    *   **`list`**: View a list of available Stripe Samples that can be created and bootstrapped by the CLI.
*   **`stripe serve`**: Start an HTTP server to serve static files, which is particularly useful for working with Stripe Samples. You can specify the directory to serve and the port to use.

### Additional Commands and Information

*   **`stripe completion`**: Set up autocompletion for Bash and ZSH shells to make using the CLI more efficient.
*   **`stripe help`**: Get help documentation for any command in the CLI. The `-h` or `--help` flag is also accepted by every command.
*   **`stripe version`**: Get the version of the Stripe CLI and check for available software updates.
*   **`stripe feedback`**: Provides information on how to give feedback for the Stripe CLI via GitHub issues and a dedicated feedback form.
*   **`stripe terminal quickstart`**: A command to quickly set up Stripe Terminal with the Verifone P400 reader. It only supports the `--api-key` flag.
*   **`stripe docker`**: Information on using the Stripe CLI within a Docker container, including environment variables and how to handle ephemeral containers.
*   **`stripe telemetry`**: Details about the CLI's telemetry feature, which collects usage data to improve the developer experience. This section explains what data is collected, what is not, why it's collected, and how to opt out.
*   **`stripe license`**: Information about the license under which the Stripe CLI is distributed.

### Global Flags

The Stripe CLI supports several global flags that can be used with most commands:

*   **`--api-key`**: Use the Stripe account associated with the provided Stripe API secret key.
*   **`--color`**: Enable or disable color output (`on`, `off`, `auto`).
*   **`--config`**: Specify a custom path for the CLI's configuration file.
*   **`--device-name`**: Run a command on behalf of another device.
*   **`-h, --help`**: Display help documentation for a command.
*   **`--log-level`**: Set the level of detail for log messages (`debug`, `info`, `warn`, `error`).
*   **`-p, --project-name`**: Define a project name for the CLI's current configuration, enabling multiple configurations.
*   **`-v, --version`**: Print the version of the Stripe CLI.