agentleFS
StripeKnown publisherstripe/stripe-cli/CLAUDE.md

stripe-cli

CLAUDE.md2.2k starsChanged 6 months agoApache-2.0View on GitHub

When building temporary binaries with Go tooling directly (e.g. go build -o ..., go test -c -o ...), place them in bin/ rather than /tmp — bin/ is gitignored and within the project's trusted directory. macOS security may block execution of binaries built outside the project tree. go generate ./... is triggered by //go:generate directives in pkg/cmd/root.go: - Generates pkg/cmd/resources_cmds.go from OpenAPI spec → CLI resource commands - Generates pkg/proxy/events_list.go → list of Stripe event types - Generates pkg/requests/stripe_version_header.go →…

  • Commits and pushes

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 1 mentionAug 2026: 1 mentionSep 2026: 10 mentionsOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the stripe/stripe-cli repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about stripe/stripe-cli

The biggest 5 of 27 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 27

Talked about on GitHub and Hacker News (27 times).

On GitHub · 26

21 more on GitHub

On Hacker News · 1

The file

We split this CLAUDE.md into the rules it gives an agent

5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When building temporary binaries with Go tooling directly (e.g.

    line 17
  2. Very specific:

    If direnv isn't installed, you can fallback by setting GH_HOST on all gh commands:

    line 54
  3. Very specific:

    Error handling: Use typed errors (e.g., RequestError), check with errors.As.

    line 64
  4. Very specific:

    Testing: Use testify/assert and testify/require.

    line 65
  5. Very specific:

    Default value is "master" for dev builds.

    line 92

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

Build & Test Commands

make build              # Build binary (runs go generate first)
make test               # Run tests with race detector and coverage
make lint               # Run golangci-lint v2
make fmt                # Format with gofmt + goimports
make ci                 # Full CI: build-all-platforms + test + go-mod-tidy + protoc-ci
make protoc             # Regenerate all protobuf code
make setup              # Download Go modules
go build ./...          # Quick compilation check
go vet ./...            # Static analysis

When building temporary binaries with Go tooling directly (e.g. go build -o ..., go test -c -o ...), place them in bin/ rather than /tmp — bin/ is gitignored and within the project's trusted directory. macOS security may block execution of binaries built outside the project tree.

Project Structure

  • cmd/stripe/main.go - Entry point
  • pkg/cmd/ - All CLI commands (Cobra). root.go registers everything
  • pkg/cmd/resources_cmds.go - Auto-generated from OpenAPI spec (do not edit manually)
  • pkg/proxy/events_list.go - Auto-generated event type list
  • pkg/gen/ - Code generation logic and templates (gen_resources_cmds.go, gen_events_list.go)
  • api/openapi-spec/ - OpenAPI specs consumed by code generation
  • rpc/ - Protobuf definitions and generated gRPC code
  • pkg/plugins/ - HashiCorp go-plugin based plugin system
  • pkg/proxy/ - Webhook forwarding proxy (stripe listen)
  • pkg/websocket/ - WebSocket client for live event streaming
  • pkg/rpcservice/ - gRPC server for external integrations
  • pkg/requests/ - HTTP request building and Stripe API interaction
  • pkg/stripe/ - Low-level Stripe HTTP client
  • pkg/fixtures/ - Declarative test data creation
  • pkg/config/ - CLI configuration management
  • pkg/login/ - Authentication flows
  • .goreleaser/ - Per-platform release configs (linux, mac, windows)

Code Generation

go generate ./... is triggered by //go:generate directives in pkg/cmd/root.go:

  • Generates pkg/cmd/resources_cmds.go from OpenAPI spec → CLI resource commands
  • Generates pkg/proxy/events_list.go → list of Stripe event types
  • Generates pkg/requests/stripe_version_header.go → API version constants

Templates live in pkg/gen/*.go.tpl. Build tags gen_resources and events_list gate the generators.

GitHub CLI

GH_HOST should be github.com to ensure gh commands target public GitHub, not GitHub Enterprise. This should already be configured through .envrc. If GH_HOST isn't yet showing github.com, then run direnv allow.

If direnv isn't installed, you can fallback by setting GH_HOST on all gh commands:

GH_HOST=github.com gh pr create ...
GH_HOST=github.com gh pr view ...

Key Conventions

  • Import ordering: stdlib, then external packages, then github.com/stripe/stripe-cli/... (enforced by goimports with local-prefixes)
  • Error handling: Use typed errors (e.g., RequestError), check with errors.As. User-facing errors go to stderr
  • Testing: Use testify/assert and testify/require. Mock HTTP with httptest.NewServer. Mock filesystem with spf13/afero
  • Naming: snake_case files, PascalCase exported types, generated files have // This file is generated; DO NOT EDIT. header
  • Indentation: Tabs for Go, 2-space for JSON/YAML/Markdown

Architecture Notes

Command types:

  1. Manual commands in pkg/cmd/*.go (login, listen, trigger, etc.)
  2. Auto-generated resource commands from OpenAPI (stripe customers create, stripe billing meters list, etc.)
  3. Plugin commands loaded dynamically at startup

Request flow: Cobra command → pkg/requests/base.go request builder → pkg/stripe/client.go HTTP client → response handler → output

Two API styles: v1 (form-encoded params) and v2 (JSON body). The --stripe-version and content-type headers differ accordingly.

Build tags: dev, localdev (plugin dev mode), gen_resources, events_list

Linting

golangci-lint v2 config is in .golangci.yml. Enabled linters include staticcheck, govet, unused, ineffassign, misspell, dupl, and others. The resources_cmds.go file is excluded from dupl checks. Several staticcheck style checks (ST*, QF*) are suppressed.

Version Injection

GoReleaser sets the version at build time via:

-ldflags "-s -w -X github.com/stripe/stripe-cli/pkg/version.Version={{.Version}}"

Default value is "master" for dev builds.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.