Skip to content

Developing the Stripe CLI

Richard Marmorstein edited this page Mar 15, 2021 · 7 revisions

If you're working on developing the CLI, it's recommended that you alias the go command to run the dev version. Place this in your shell rc file (such as .bashrc or .zshrc)

Installation

The Stripe CLI is built using Go. You will need at least go version 1.16 to develop. To download and compile the source code, run:

$ go get -v -u github.com/stripe/stripe-cli/...

After installing, cd into the directory and setup the dependencies:

$ cd go/src/github.com/stripe/stripe-cli
$ make setup

Once setup, run the test suite to make sure everything works as expected:

$ make test

You can invoke the local version of the CLI by running:

$ go run cmd/stripe/main.go

Optionally, you can add this to your shell profile to make running the local version a little easier.

alias stripe-dev='go run cmd/stripe/main.go'

Linting

To run the linter, run make lint.

Make sure golangci-lint is installed: brew install golangci/tap/golangci-lint

Tests

You can run tests with:

$ make test

Releasing

To release a new version, checkout master and then run make release. It'll prompt you for a version and will then push a new tag.