How stripe/stripe-cli works
Stripe CLI is a terminal client for testing webhooks, managing Stripe API objects, inspecting request logs, and handling account authentication. The primary workflow starts at the executable, dispatches a command, and uses shared API, configuration, or streaming services to produce a terminal result. The README establishes the major command capabilities; sampled source confirms selected command, authentication, API, and event-processing links. Several command implementations were not sampled, so those subsystem links are documented or marked unverified rather than inferred as direct calls.
Main entry points: root.go Command dispatch · databases.go Resource commands · main.go Executable · client_login.go Interactive login
Components 22
CLI entry
- Executable
cmd/stripe/main.go - Command dispatch
pkg/cmd/root.go
Account and setup
- Interactive login
pkg/login/client_login.go - Device OAuth
pkg/login/oauth_device.go - Profiles and config
pkg/config/profile.go - Credential storage
pkg/keyring/keyring.go
API and resources
- Resource commands
pkg/cmd/resource/databases.go - Resource generation
pkg/gen/gen_resources_cmds.go - API specification
pkg/spec/spec.go - API request handling
pkg/requests/base.go - Stripe API client
pkg/stripe/client.go
Webhook and event testing
- Webhook commands
pkg/cmd/listen.go - Webhook forwarding
pkg/proxy/webhook_event_processor.go - Event stream client
pkg/websocket/client.go - Request log tailing
pkg/logtailing/tailer.go
Shared runtime
- Agent skills
pkg/agentskills/agentskills.go - Sandbox support
pkg/sandbox/sandbox.go - Input parsing
pkg/parsers/parsers.go - Auto update
pkg/autoupdate/checker.go
Other components
- CLI user
- Stripe services
- Local webhook endpoint
Connections 24
- CLI user → Executable: runs command
- Executable → Command dispatch: executes
cmd/stripe/main.go - Executable → Auto update: checks updates
cmd/stripe/main.go - Command dispatch → Interactive login: offers login
- Interactive login → Device OAuth: authenticates
- Interactive login → Credential storage: transfers credentials
pkg/login/client_login.go - Device OAuth → Profiles and config: uses configuration
pkg/login/oauth_device.go - Command dispatch → Resource commands: dispatches resource work
- Resource generation → API specification: reads specification
pkg/gen/gen_resources_cmds.go - Resource generation → Resource commands: generates commands
pkg/gen/gen_resources_cmds.go - Resource commands → Stripe API client: makes API calls
pkg/cmd/resource/databases.go - API request handling → Stripe API client: performs requests
- Stripe API client → Stripe services: sends API requests
pkg/stripe/client.go - Command dispatch → Webhook commands: dispatches listen
- Webhook commands → Webhook forwarding: forwards events
- Webhook forwarding → Event stream client: acknowledges events
pkg/proxy/webhook_event_processor.go - Event stream client → Stripe services: streams events
- Webhook forwarding → Local webhook endpoint: posts events
pkg/proxy/webhook_event_processor.go - Command dispatch → Request log tailing: offers log tail
- Request log tailing → Event stream client: uses event stream
pkg/logtailing/tailer.go - Command dispatch → Agent skills: offers agent skills
- Command dispatch → Sandbox support: offers sandbox tools
- Resource commands → Input parsing: parses input
- CLI user → Local webhook endpoint: receives webhook