MCPcopy Index your code
hub / github.com/antiwork/gumroad-cli

github.com/antiwork/gumroad-cli @v0.20260706.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.20260706.1 ↗ · + Follow
3,812 symbols 27,237 edges 357 files 190 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Gumroad Gumroad CLI

CLI for the Gumroad API. Designed for humans and AI agents alike.

Install

brew install antiwork/cli/gumroad

Other installation methods

# Shell script
curl -fsSL https://gumroad.com/install-cli.sh | bash

# Go
go install github.com/antiwork/gumroad-cli/cmd/gumroad@latest

# From source (default prefix)
make install
# From source (custom prefix)
make install PREFIX="$HOME/.local"

Quick start

# Authenticate with device approval
gumroad auth login

# Or use an environment variable for CI / agents
export GUMROAD_ACCESS_TOKEN=your-token

# View your account
gumroad user

# View or set your account refund policy
gumroad refund-policy view
gumroad refund-policy set --period 30 --fine-print "Refund requests are reviewed within 2 business days."

# List products, then inspect one
gumroad products list
gumroad products view abc123

# Fetch all sales, filter with jq
gumroad sales list --all --json --jq '.sales[] | {email, formatted_total_price}'

# Show sales totals
gumroad sales summary --group-by month --from 2026-01-01 --to 2026-05-21

# Preview a refund without executing it
gumroad sales refund abc123 --amount 5.00 --dry-run

Authentication

gumroad auth login starts OAuth device authorization. It prints a Gumroad approval URL, waits while you approve in the browser, then stores the seller token locally.

gumroad auth login          # Device authorization (default)
gumroad auth login --web    # Local browser OAuth
gumroad auth login --with-token < token.txt
gumroad auth status         # Check seller auth and stored admin auth
gumroad auth token          # Print the active seller token
gumroad auth logout         # Revoke/delete stored tokens

For CI and agents with an existing token, set GUMROAD_ACCESS_TOKEN or pipe the token into gumroad auth login --with-token; GUMROAD_ACCESS_TOKEN takes precedence over stored seller config and needs no interactive login. Use --web only when you specifically want the local browser PKCE flow.

Commands

Run gumroad --help and gumroad <command> --help for subcommands, usage details, and examples.

Admin commands use a separate internal token. Run gumroad auth login --web and check the admin box to store one locally, or use GUMROAD_ADMIN_TOKEN with --non-interactive in CI and agent runs. For local testing, set GUMROAD_ADMIN_API_BASE_URL.

Which token does a command use?

Command group Token Env var
user, products, sales, files, subscribers, payouts, licenses, offercodes, webhooks, … Seller access token GUMROAD_ACCESS_TOKEN
gumroad admin … Admin token (separate credential) GUMROAD_ADMIN_TOKEN

The two are not interchangeable. If a seller command fails with not_authenticated while GUMROAD_ADMIN_TOKEN is set — either alone, or copied into GUMROAD_ACCESS_TOKEN — you need a seller token: set GUMROAD_ACCESS_TOKEN to a seller token or run gumroad auth login.

Output modes

Flag Output Use case
(default) Colored, formatted output Human reading
--json JSON Programmatic access
--jq <expr> Filtered JSON Extract specific fields
--plain Tab-separated, control chars escaped Piping to grep/awk
--quiet Minimal Scripts

Paginated commands (sales list, payouts list, subscribers list) accept --all to fetch every page. Use --page-delay 200ms to pace large fetches.

AI agents

gumroad is built to work with AI agents. The --json, --jq, --no-input, and --non-interactive flags make it easy to query Gumroad data programmatically. Agents can start fresh seller auth with gumroad auth login and hand the printed approval URL to a human, or use GUMROAD_ACCESS_TOKEN for a no-persistence auth path when a token already exists.

An agent skill is included. Run gumroad skill to install or refresh it.

Development

make build        # Compile to ./gumroad
make test         # Run all tests
make test-cover   # Tests with per-package coverage gates (85% cmd, 90% infra)
make test-smoke   # Live read-only smoke test against real API
make lint         # golangci-lint
make man          # Generate man pages
make snapshot     # Build release snapshot via goreleaser

Live smoke test:

GUMROAD_ACCESS_TOKEN=your-token make test-smoke

License

MIT

Extension points exported contracts — how you extend this code

HintedError (Interface)
HintedError is implemented by errors that carry an actionable recovery suggestion. [1 implementers]
internal/api/errors.go
PageVisitor (FuncType)
(no doc)
internal/cmdutil/pagination.go
OptionsMutator (FuncType)
(no doc)
internal/testutil/testutil.go
ClientRunner (FuncType)
(no doc)
internal/admincmd/read.go
ClientRunner (FuncType)
(no doc)
internal/cmdutil/read.go

Core symbols most depended-on inside this repo

Command
called by 886
internal/testutil/testutil.go
JSON
called by 804
internal/testutil/testutil.go
CaptureStdout
called by 741
internal/testutil/testutil.go
Setup
called by 730
internal/testutil/testutil.go
MustExecute
called by 639
internal/testutil/testutil.go
Error
called by 550
internal/cmd/files/complete.go
Out
called by 412
internal/cmdutil/options.go
SetupAdmin
called by 350
internal/testutil/testutil.go

Shape

Function 3,331
Struct 328
Method 134
TypeAlias 8
FuncType 7
Interface 4

Languages

Go100%

Modules by API surface

internal/cmd/products/products_test.go109 symbols
internal/cmd/auth/auth_test.go94 symbols
internal/cmd/sales/sales_test.go71 symbols
internal/cmd/variants/variants_test.go67 symbols
internal/cmd/upsells/upsells_test.go58 symbols
internal/cmd/root_test.go54 symbols
internal/api/client_test.go53 symbols
internal/cmd/offercodes/offercodes_test.go52 symbols
internal/cmd/errors_test.go47 symbols
internal/upload/upload_test.go46 symbols
internal/cmd/products/content_test.go44 symbols
internal/cmd/emails/emails_test.go44 symbols

For agents

$ claude mcp add gumroad-cli \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page