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.

Comments
  • 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 28
  • 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
  • DX-7509: redact livemode values in existing configs

    DX-7509: redact livemode values in existing configs

    Reviewers

    r? @ cc @stripe/developer-products

    Summary

    • redact livemode values from existing configs
    • rename publishable keys to fix the stripe config --list --project-name <project_name> issue; viper has a limit on the key name length
    • return login is required error when livemode keys are not present in the secure storage. this will force users to log in even when they have old livemode key values in existing configs
    • add ability to remove livemode values from secure storage
    opened by etsai-stripe 15
  • 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
  • For plugins, only enable color output if command is running in a terminal

    For plugins, only enable color output if command is running in a terminal

    Reviewers

    r? @ cc @stripe/developer-products

    Summary

    This PR changes the plugin interface so that the host tells the plugin process if the host's stdin/out/err are terminals or not. Plugins can read this this to decide if they should print color output. In addition, this opens up the possibility of adding other terminal-only features, evolving the plugin interface, and separating concerns between host and plugin.

    This change is needed because functions like term.IsTerminal always return false when called inside the plugin due to how the plugin's file descriptors are managed by the host process.

    To change the interface, we leverage the go-plugin package's versioning ability to implement a "major change" to the plugin interface. The old interface is defined as:

    type Dispatcher interface {
    	RunCommand(args []string) (string, error)
    }
    

    while the new interface is defined as:

    type DispatcherGRPC interface {
    	RunCommand(additionalInfo *proto.AdditionalInfo, args []string) error
    }
    

    This new interface uses gRPC instead of net/rpc to handle IPC between the host and plugin. gRPC is needed because the net/rpc implementation can't handle serializing complex data structures, which we've introduced in a struct called AdditionalInfo.

    This change is backwards compatible because the go-plugin library automatically handles version negotiation. Although the new interface is backwards incompatible, we keep the old interface around so older clients can continue to request the old interface.

    opened by vcheung-stripe 0
  • Stripe CLI not using auth from keychain

    Stripe CLI not using auth from keychain

    Issue

    I can successfully log in with stripe login, and credentials are properly written into the Ubuntu keychain + ~/.config/stripe/config.toml under the default project

    When running stripe listen --live or stripe events resend --live, I always get redirected to the login flow. The CLI calls succeed when I include the restricted API key

    Expected Behavior

    After successfully logging in with stripe login, I should not have to include an API key to CLI commands for them to work

    Steps to reproduce

    • Run stripe login
    • Call e.g. stripe listen --live
    • The listened should correctly start

    Traceback

    I don't know how to get debug logs, could not see any error logs

    Environment

    Ubuntu 22.04.1 LTS stripe CLI v1.13.6

    bug 
    opened by yassinecc 1
  • Unable to create a customer.subscription.updated event with a given status

    Unable to create a customer.subscription.updated event with a given status

    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 am trying to create via CLI a customer.subscription.update event with a given status that is not active. I am thus running the following command:

    stripe trigger customer.subscription.updated --override subscription:status=active

    But I get an error from the terminal `Trigger failed: Request failed, status=400, body={ "error": { "code": "parameter_unknown", "doc_url": "https://stripe.com/docs/error-codes/parameter-unknown", "message": "Received unknown parameter: status", "param": "status", "request_log_url": "https://dashboard.stripe.com/test/logs/req_HDSf78aUqpHklF?t=1672071633", "type": "invalid_request_error" } }

    `

    Expected Behavior

    I would expect to be able to generate an event of subscription update with a given status

    Steps to reproduce

    1. Run: stripe trigger customer.subscription.updated --override subscription:status=active
    bug 
    opened by LeandroParisi 0
  • stripe listen --forward-to ... get the response content

    stripe listen --forward-to ... get the response content

    Problem

    On my Laravel project, i would love to do some debbuging & i try to do stuff like dump($object);

    Nonetheless, with stripe listen --forward-to ... the best i could get as response is [200] POST example.com [evt_xxx] i could build logs in a file to see what's happen on my side, but that would be really convenient to get the result of my dump() directly in the console output.

    Feature

    output the stripe listen --forward-to ... Response content

    Examples

    add a flag to stripe listen... stripe listen --forward-to example.com:8080 --content or ? stripe listen --forward-content-to example.com:8080

    workaround for Laravel user

    2 solutions that i have found is to use one of those packages (seem to have conflict when using both) : laravel/telescope or beyondcode/laravel-dump-server

    enhancement 
    opened by Ronan-Lenor 0
  • Client.Timeout on CLI

    Client.Timeout on CLI

        I'm having the same issue. And yes the "FAIL" message does appear 30s after the request. 
    
    Screen Shot 2022-12-14 at 12 15 20

    Originally posted by @gabrielmsoptimalex in https://github.com/stripe/stripe-cli/issues/710#issuecomment-1351607706

    opened by gabrielmsoptimalex 0
  • Failed to POST with EOF

    Failed to POST with EOF

    To start with in case it may be a version problem, I first installed the stripe-cli somewhere around March and April and used it quite extensively back then, and I haven't used it too much since june-july.

    Issue

    I ran the cli with the command:

    stripe listen --forward-to http://localhost:8000/api/stripe-webhook

    I then created a subscription in the backend, expecting the customer.subscription.created and customer.created events to fire, which they do, however, every event that fires fails with:

    2022-12-01 08:29:32   --> customer.subscription.created [evt_x]
    2022-12-01 08:29:32            [ERROR] Failed to POST: Post "http://localhost:8000/api/stripe-webhook": EOF
    

    The logs in our backend don't show anything, and therefore it seems as if it doesn't reach the endpoint at all. The logs in the Stripe dev dashboard doesn't show them at all as failed.

    Tested:

    • Checked the webhook signing secret in backend and cli
    • Changed API key in cli to a new one from the developers dashboard with all permissions "write"
    • Added --latest to the command
    • Forwarded to https

    Any ideas?

    Expected Behavior

    The webhook event should be forwarded to the correct endpoint

    Steps to reproduce

    • Run the listen command on Mac

    Traceback

    [Thu, 01 Dec 2022 08:24:06 EET] DEBUG proxy.Proxy.processWebhookEvent: Processing webhook event webhook_converesation_id=1669875846-x webhook_id=1669875846-x
    [Thu, 01 Dec 2022 08:24:06 EET] DEBUG Setting read deadline:
    [Thu, 01 Dec 2022 08:24:06 EET] DEBUG proxy.Proxy.processWebhookEvent: Processing webhook event webhook_converesation_id=1669875846-x webhook_id=1669875846-x
    [Thu, 01 Dec 2022 08:24:06 EET] DEBUG proxy.Proxy.filterWebhookEvent: Received event with default API version, ignoring
    [Thu, 01 Dec 2022 08:24:06 EET] DEBUG websocket.Client.writePump: Sending text message
    [Thu, 01 Dec 2022 08:24:06 EET] DEBUG proxy.EndpointClient.Post: Forwarding event to local endpoint
    [Thu, 01 Dec 2022 08:24:06 EET]2022-12-01 08:24:06   --> invoice.payment_succeeded [evt_x]
     DEBUG websocket.Client.writePump: Sending text message
    2022-12-01 08:24:06            [ERROR] Failed to POST: Post "http://localhost:8000/api/stripe-webhook": EOF
    

    Environment

    macOS

    bug 
    opened by khmob 0
Releases(v1.13.6)
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 2.1k Dec 30, 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 713 Dec 31, 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 516 Jan 8, 2023
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 2.1k Jan 8, 2023
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.7k Jan 7, 2023
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 754 Dec 31, 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 Dec 29, 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 162 Jan 2, 2023
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 176 Dec 27, 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.8k Jan 9, 2023
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 30.9k Jan 7, 2023
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 188 Dec 20, 2022