1 { lib, buildGoModule, fetchFromGitHub, installShellFiles, stdenv }:
7 src = fetchFromGitHub {
11 sha256 = "sha256-jos6SZ2ZkUeWOM0ALlsc5a+5kcullNF/2AknTQpRnIc=";
13 vendorSha256 = "sha256-1c+YtfRy1ey0z117YHHkrCnpb7g+DmM+LR1rjn1YwMQ=";
15 nativeBuildInputs = [ installShellFiles ];
20 "-X github.com/stripe/stripe-cli/pkg/version.Version=${version}"
24 # the tests expect the Version ldflag not to be set
26 '' + lib.optionalString (
27 # delete plugin tests on all platforms but exact matches
28 # https://github.com/stripe/stripe-cli/issues/850
30 (platform: lib.meta.platformMatch stdenv.hostPlatform platform)
31 [ "x86_64-linux" "x86_64-darwin" ]
33 rm pkg/plugins/plugin_test.go
37 installShellCompletion --cmd stripe \
38 --bash <($out/bin/stripe completion --write-to-stdout --shell bash) \
39 --zsh <($out/bin/stripe completion --write-to-stdout --shell zsh)
42 doInstallCheck = true;
43 installCheckPhase = ''
44 runHook preInstallCheck
45 $out/bin/stripe --help
46 $out/bin/stripe --version | grep "${version}"
47 runHook postInstallCheck
51 homepage = "https://stripe.com/docs/stripe-cli";
52 changelog = "https://github.com/stripe/stripe-cli/releases/tag/v${version}";
53 description = "A command-line tool for Stripe";
55 The Stripe CLI helps you build, test, and manage your Stripe integration
56 right from the terminal.
58 With the CLI, you can:
59 Securely test webhooks without relying on 3rd party software
60 Trigger webhook events or resend events for easy testing
61 Tail your API request logs in real-time
62 Create, retrieve, update, or delete API objects.
64 license = with licenses; [ asl20 ];
65 maintainers = with maintainers; [ RaghavSood jk ];
66 mainProgram = "stripe";