A command-line tool for Stripe

Overview

Stripe CLI

GitHub release (latest by date) Build Status

The Stripe CLI helps you build, test, and manage your Stripe integration right from the terminal.

With the CLI, you can:

  • Securely test webhooks without relying on 3rd party software
  • Trigger webhook events or resend events for easy testing
  • Tail your API request logs in real-time
  • Create, retrieve, update, or delete API objects.

demo

Installation

Stripe CLI is available for macOS, Windows, and Linux for distros like Ubuntu, Debian, RedHat and CentOS.

macOS

Stripe CLI is available on macOS via Homebrew:

brew install stripe/stripe-cli/stripe

Linux

Refer to the installation instructions for available Linux installation options.

Windows

Stripe CLI is available on Windows via the Scoop package manager:

scoop bucket add stripe https://github.com/stripe/scoop-stripe-cli.git
scoop install stripe

Docker

The CLI is also available as a Docker image: stripe/stripe-cli.

docker run --rm -it stripe/stripe-cli version
stripe version x.y.z (beta)

Without package managers

Instructions are also available for installing and using the CLI without a package manager.

Usage

Installing the CLI provides access to the stripe command.

stripe [command]

# Run `--help` for detailed information about CLI commands
stripe [command] help

Commands

The Stripe CLI supports a broad range of commands. Below is some of the most used ones:

Documentation

For a full reference, see the CLI reference site

Telemetry

The Stripe CLI includes a telemetry feature that collects some usage data. See our telemetry reference for details.

Feedback

Got feedback for us? Please don't hesitate to tell us on feedback.

Contributing

See Developing the Stripe CLI for more info on how to make contributions to this project.

License

Copyright (c) Stripe. All rights reserved.

Licensed under the Apache License 2.0 license.

Issues
  • No such host

    No such host

    I am receiving events but also receive errors when trying to reach the local app. Setup is Laravel 5.7 with Homebrew and Valet.

    Ready! Your webhook signing secret is whsec... [Sun, 21 Jul 2019 13:52:21 CEST] INFO Received event: evt_1EydaSJFP015mQcJpyAozhkF [type: payment_intent.created] [Sun, 21 Jul 2019 13:52:21 CEST] ERROR Failed to POST event to local endpoint, error = Post https://myappname.test/hooks/stripe/paymentintent: dial tcp: lookup friendships.test on MYIP:53: no such host

    bug 
    opened by MrMooky 27
  • Display account info before resource command execution

    Display account info before resource command execution

    Reviewers

    r? @richardm-stripe @tomer-stripe @pepin-stripe cc @stripe/developer-products

    Summary

    This PR is a potential and partial solution to Issue #489 This PR results in displaying the mode (live/test) and dashboard display name before execution of a resource command (like stripe customers create .... etc.) It also confirms whether the user wants to proceed with the command or not. An image for the example output is attached

    Future Work

    I plan to add this display info and confirmation with the rest of the Stripe CLI commands as well as add a flag in case the user wants to skip this confirmation and account information display. Confirmation Denied Confirmed

    opened by ritikbhatia 21
  • Stripe connection failure with i/o timeout

    Stripe connection failure with i/o timeout

    Issue

    I was trying to set up a local Websocket listener, but the stripe listen doesn't work.

    Expected Behavior

    It should start listening.

    Steps to reproduce

    1. brew install stripe/stripe-cli/stripe
    2. stripe login
    3. stripe listen

    Traceback

    80228606-dc32b500-8614-11ea-9be9-cbd32ea24b9b

    Environment

    MacOS Catalina 10.15.4 Stripe version 1.13.11

    bug 
    opened by louisbirla 21
  • Support checkout webhooks

    Support checkout webhooks

    Problem

    Testing checkout webhook checkout.session.completed I cant even find docs what will object checkout.session.completed look like in webhook and cant test with cli and testing on real domains or tunnels is a pain

    Feature

    trigger checkout.session.completed

    Examples

    enhancement 
    opened by aldarund 20
  • "the file contains a virus" on Windows 10

    Issue

    Hello - I downloaded and unzipped stripe_1.3.4_windows_x86_64.zip and ran the stripe.exe binary inside but received:

    Operation did not complete successfully because the file contains a virus or potentially unwanted software.

    image

    Expected Behavior

    I think I expected an installer to run.

    Steps to reproduce

    On Windows 10 v2004 (19041.84), download and unzipp stripe_1.3.4_windows_x86_64.zip and run the stripe.exe binary, accept any warnings about running untrusted software.

    Traceback

    None.

    Environment

    Windows 10 v2004 (19041.84)

    bug 
    opened by lukepuplett 19
  • listen fails when run non-interactively

    listen fails when run non-interactively

    Issue

    I am trying to run stripe listen non-interactively in one docker container to proxy events to a different docker container, so that I can validate my webhooks in an automated test.

    I run:

    stripe listen --device-name my-test --api-key sk_test_XXXX
    

    The output is:

    your device name has not been configured. Use `stripe configure` to set your device name
    

    but if I then run:

    stripe configure
    

    it outputs:

    unknown command "configure" for "stripe"
    

    So, the issue is:

    1. I don't know what a device is, but according to stripe listen --help I should be able to set this with --device-name. The first command should succeed as is.
    2. The error output should not refer to a nonexistent command.

    If I populate ~/.config/stripe/config.toml directly instead of using command-line flags, stripe listen works great. (While undocumented, this might be a better idea regardless, because then I don't need to worry about my API key being in an error message if the command fails.)

    Environment

    Ubuntu 18.04 running under Docker, Stripe CLI 0.2.3 installed via https://github.com/stripe/stripe-cli/releases/download/v0.2.3/stripe_0.2.3_linux_amd64.deb.

    Postscript

    stripe listen is great. I've been wanting something like this for a long time.

    bug 
    opened by madeleineth 19
  • Stripe cli doesn't receive any event from stripe

    Stripe cli doesn't receive any event from stripe

    Issue

    When a create a subscription in test mode, events are triggered in the dashboard, but the stripe cli, which is listening with ./stripe.exe listen --load-from-webhooks-api --forward-to api.myapp.local --log-level debug receives nothing

    Expected Behavior

    I should get the events trigerred from the dashboard sent to my local app

    Steps to reproduce

    Define webhooks, login via stripe cli and redirect to local app loading webhooks via api, then do an action that triggers one of the listened events. If I manually trigger the event via stripe trigger [...] my application webhook is correctly called, but I'd like to work with my test data. After a few tests, I find out that only API generated events are received to the cli, but why ?

    Traceback

    Nothing, and I can see the events via stripe logs tail

    Environment

    Windows and Debian via WSL2

    bug 
    opened by Geekimo 18
  • Stops forwarding events after a while

    Stops forwarding events after a while

    Issue

    After going to sleep / some inactivity causing the connection to time out (could be wifi reset), the tool will keep listening but it won't be receiving any events.

    Expected Behavior

    If the connection gets reset, it should try to renew the connection

    Steps to reproduce

    1. Start with stripe listen and other parameters
    2. Leave the command running for a while (couple of hours..). Alternatively try to turn off your wifi or put the computer to sleep whilst it's running (long enough so that the OS cuts off networking).
    3. The command is still running but it's stale and won't receive any events (it still thinks it's listening to events?)

    Environment

    Linux 5.13-4-arch2-1, however might be applicable to all OSes given the right circumstances

    bug 
    opened by matejkramny 14
  • Virus reported in latest release

    Virus reported in latest release

    The more information we have the easier it is for us to help. Feel free to remove any sections that might not apply

    This is probably a false positive related to #379 but I'm not sure you all monitor old closed issues and would like to make sure you're aware of it.

    Issue

    Describe what happened and what you were trying to do Downloaded the latest release (1.4.5) with Windows Defender turned on. Windows Defender reported a virus in the zip.

    Expected Behavior

    Tell us what you expected to happen To download a clean executable.

    Steps to reproduce

    What are the steps we can take to reproduce this and verify it's fixed? Download the latest release for x64 or 32 bit.

    Traceback

    Share any debug output that was given by the CLI image

    Environment

    Select one of: macOS, Linux, Windows, Other Windows 10

    bug 
    opened by withinboredom 14
  • Unable to run stripe listen

    Unable to run stripe listen

    The more information we have the easier it is for us to help. Feel free to remove any sections that might not apply

    Issue

    I followed the instructions to setup and use the CLI. I managed to login correctly and so, but when I run stripe listen it is stuck on "Getting ready". I added --skip-verify --log-level=debug flags and the response is the following:

    image

    I tried also login by using

    stripe login -i

    And same result

    I can use commands like stripe customers create without any problem.

    Expected Behavior

    To be able to use stripe listen

    Steps to reproduce

    stripe login

    stripe listen

    Environment

    OS: MAC Catalina CLI version: 1.3.10

    bug 
    opened by charlie632 14
  • auto-create

    auto-create "required resources" on stripe sample create

    Reviewers

    r? @stripe/developer-products

    Summary

    Paired on this with @cjavilla-stripe, who requested this feature.

    Today stripe samples create very conveniently will copy over a user's secret key/publishable key/webhook signing secret into the .env file of the Stripe Sample.

    For some samples, this is all the configuration the sample needs, and it's ready to go! But some samples -- often billing-related -- have additional dependencies. They require the user to create a resource on their account in testmode, and add the corresponding id to the .env as well. At best, this is inconvenient. At worst, this is confusing, since it is not always very obvious what kind of resource you will need, or what API call you will need to make to create it -- especially for users who are just trying out Stripe for the first time.

    This PR begins to solve that problem by introducing the concept of a "required resource" which can be automatically created and configured during stripe samples create.

    Here's how it works:

    1. Each stripe sample defines their "requiredResources" inside .cli.json (example).
    2. A hardcoded lookup table inside the stripe-cli code defines a POST request capable of generating that type of resource (code).
    3. When the user runs stripe samples create <name>, if the stripe sample defines any resources that have not already been created, they receive a prompt asking permission to automatically create them. image
    4. If they select yes, then a POST request is made to testmode underneath the currently active profile. If the post request is successful, the value of the "id" field in the response is written to the user's profile in their stripe-cli config (so that it can be re-used on future invocations of stripe samples create)
    5. When the .env file is copied from the example, any of the required resource IDs present in the user's profile are written as environment variables there as well (like is already happening for secret key/publishable key)

    Notes:

    • There's a hardcoded list here in stripe-cli. If somebody wants to add a new type of "required resource", they will need to add an entry to that list.
    • If the user deletes one of these auto-created resources but doesn't clear it from their stripe-cli config, they won't see the prompt anymore and stripe samples create will copy over an id that doesn't exist and so the sample will not work.
    opened by richardm-stripe 12
  • Add ARCHITECTURE.md file

    Add ARCHITECTURE.md file

    Reviewers

    r? cc @stripe/developer-products

    Summary

    After reading through the code, add an ARCHITECTURE file, outlining the general structure of the codebase and hottest code paths. This was mostly meant as an exercise for myself, but I've found it helpful to save and maintain these documents over time.

    Also, I haven't done much work in this codebase, so please double check that what I wrote is accurate and helpful! Also, feel free to suggest other important sections that a new contributor would find helpful when diving into an unfamiliar codebase.

    opened by xavdid-stripe 0
  • Add pending_invoice_items_behavior=include to invoice fixtures

    Add pending_invoice_items_behavior=include to invoice fixtures

    Reviewers

    r? @stripe/developer-products cc @stripe/developer-products @karlr-stripe

    Summary

    In version 2022-08-01, the invoice create method no longer includes the invoiceitems by default. This causes invoice.payment_failed to actually succeed in 2022-08-01 because the invoice is for zero dollars. To fix this, we set a parameter on that method to include pending invoiceitems in the invoice.

    I tested all the fixtures on 2020-08-27 and 2022-08-01 to verify the correct events are emitted in both versions.

    opened by vcheung-stripe 0
  • Storing livemode keys in macOS keychain not working with binary release for arm64

    Storing livemode keys in macOS keychain not working with binary release for arm64

    Issue

    According to DX7509, the livemode credentials are supposed to be saved in the macOS keychain. This does not work with the binary release for arm64 or when installing via homebrew. Instead, it seems like the library being used for storing credentials (https://github.com/99designs/keyring) is selecting a different 'file' credential backend by default:

    ❯ stripe customers list --live
    No directory provided for file keyring
    

    When compiling from source, I get the confirmation pop-up as expected and have to allow access to the keyring. After this, all live commands work as expected:

    image

    Instead of the mac-os_arm64 binary I also tried using the mac-os_x86_64 binary, there the keychain is working as expected. My guess is, that something is misconfigured with the cross-compilation. Specifically with the cgo support, which seems to be enabled for amd64 but not for arm64. 99designs/keyring is requiring cgo for the keychain to work.

    Expected Behavior

    I expect the stripe binary installed via brew on arm64 to prompt me keychain access when first accessing/storing credentials. Currently, the only workaround seems to be to manually provide an API key whenever accessing the live environment.

    Steps to reproduce

    On an Apple Silicon Mac.

    1. Install stripe via homebrew, alternatively use the arm64 binary release:
    brew install stripe/stripe-cli/stripe
    
    1. After logging in, execute any command in live mode:
    ❯ stripe customers list --live
    No directory provided for file keyring
    
    1. Download and extract the amd64 binary. Execute any command in live mode using this binary. If not allowed yet, a keychain dialog will pop up and prompt to enter the password, the command will succeed as expected:
    ❯ ./stripe customers list --live
    {
      "object": "list",
      "data": [
    ...
      ],
      "has_more": true,
      "url": "/v1/customers"
    }
    

    Environment

    stripe: 1.10.4 compile: go1.19 darwin/arm64 with cgo enabled

    bug 
    opened by friedemannf 1
  • Local listener not recognizing `.localhost` TLD

    Local listener not recognizing `.localhost` TLD

    Issue

    I am running an application on the .localhost TLD, in particular a multi-level subdomain (i.e. foo.bar.localhost:3000), which works out of the box without any /etc/hosts customization in Google Chrome and Firefox. I expected it to also work out of the box with the Stripe CLI when setting up a local listener:

    stripe listen --project-name=bar --forward-to foo.bar.localhost:3000/webhook/stripe
    

    Unfortunately, that does not work as expected, with me having to explicitly define foo.bar.localhost 127.0.0.1 in /etc/hosts.

    While definitely not the end of the world, it'd be great if the Stripe CLI worked seamlessly with the .localhost TLD!

    Environment

    macOS 12.5

    bug 
    opened by agrobbin 0
  • Add autocompletion for fish shell

    Add autocompletion for fish shell

    Problem

    Currently stripe-cli does not support shell autocompletion for fish shell.

    Feature

    Please consider adding an autocompletion for fish-shell. Overall UX would improve for fish shell users.

    enhancement 
    opened by matusf 0
Releases(v1.11.0)
An open-source GitLab command line tool bringing GitLab's cool features to your command line

GLab is an open source GitLab CLI tool bringing GitLab to your terminal next to where you are already working with git and your code without switching

Clement Sam 2k Aug 9, 2022
A command line tool to prompt for a value to be included in another command line.

readval is a command line tool which is designed for one specific purpose—to prompt for a value to be included in another command line. readval prints

Venky 0 Dec 22, 2021
git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

Table of contents Introduction Reference Contributing Introduction Overview git-xargs is a command-line tool (CLI) for making updates across multiple

Gruntwork 622 Aug 7, 2022
git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command. You give git-xargs:

Maxar Infrastructure 1 Feb 5, 2022
A command line tool for simplified docker volume command built with go

dockervol A command line tool for simplified docker volume command built with go. Features: Remove anonymous volume (beta) Remove volume by matching n

Moh Achun Armando 0 Dec 18, 2021
fofax is a fofa query tool written in go, positioned as a command-line tool and characterized by simplicity and speed.

fofaX 0x00 Introduction fofax is a fofa query tool written in go, positioned as

null 429 Aug 12, 2022
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.

asciigraph Go package to make lightweight ASCII line graphs ╭┈╯. Installation go get github.com/guptarohit/asciigraph Usage Basic graph package main

Rohit Gupta 2k Aug 5, 2022
Package command provide simple API to create modern command-line interface

Package command Package command provide simple API to create modern command-line interface, mainly for lightweight usage, inspired by cobra Usage pack

chenen 0 Jan 16, 2022
Watcher - A simple command line app to watch files in a directory for changes and run a command when files change!

Watcher - Develop your programs easily Watcher watches all the files present in the directory it is run from of the directory that is specified while

Geet Sethi 1 Mar 27, 2022
Arduino command line tool

arduino-cli Arduino CLI is an all-in-one solution that provides builder, Boards/Library Manager, uploader, discovery and many other tools needed to us

Arduino 3.5k Aug 8, 2022
Command line tool for Google Cloud Datastore, written in Go

dsio dsio is a command line tool for Google Cloud Datastore. This tool is under development. Please use in your own risk. Features Bulk upsert entitie

Shinichi Nishimura 66 Feb 8, 2022
A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a proxy.

Fake-SMS A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a pr

Narasimha Prasanna HN 720 Aug 12, 2022
pgCenter is a command-line admin tool for observing and troubleshooting Postgres.

Command-line admin tool for observing and troubleshooting Postgres.

Lesovsky Alexey 1.4k Aug 3, 2022
textnote is a command line tool for quickly creating and managing daily plain text notes.

textnote is a command line tool for quickly creating and managing daily plain text notes. It is designed for ease of use to encourage the practice of daily, organized note taking. textnote intentionally facilitates only the management (creation, opening, organizing, and consolidated archiving) of notes, following the philosophy that notes are best written in a text editor and not via a CLI.

Daniel Kaslovsky 157 Jul 12, 2022
Command line tool for adding Windows resources to executable files

go-winres A simple command line tool for embedding usual resources in Windows executables built with Go: A manifest An application icon Version inform

null 135 Aug 1, 2022
A command-line tool and library for generating regular expressions from user-provided test cases

Table of Contents What does this tool do? Do I still need to learn to write regexes then? Current features How to install? 4.1 The command-line tool 4

Peter M. Stahl 5.5k Aug 9, 2022
A command line tool for file downloads

A command line tool for file downloads

null 258 Jul 25, 2021
GitHub’s official command line tool

GitHub CLI gh is GitHub on the command line. It brings pull requests, issues, and other GitHub concepts to the terminal next to where you are already

GitHub CLI 29.4k Aug 6, 2022
A very simple command line tool for downloading YouTube videos.

GoTube Overview This repository contains a single-file implementation of YouTube video downloader written in Go. It does not require any third-party p

Jimmy Yang 185 May 15, 2022