Skip to main content
Glama
README.md
# gumroad-pp-cli

A standalone, local Go CLI for the implemented Gumroad merchant API commands. This repository is unpublished; it is not a package-install or hosted-release source.

## Install locally

Requires Go 1.24 or newer. From this checkout, build or install only from the local module path:

```sh
go install ./cmd/gumroad-pp-cli
# or
make build
./bin/gumroad-pp-cli --help
```

## Authenticate

Set an access token obtained from your Gumroad account or application. The CLI resolves a process-local `--token` first, then `GUMROAD_ACCESS_TOKEN`; it does not write either value to disk.

```sh
export GUMROAD_ACCESS_TOKEN=
```

Do not place a token in command history, examples, commits, or issue reports. `.env.example` intentionally contains only a blank variable assignment.

## Read commands

The output is a concise table by default. Add `--json` to emit one JSON value suitable for scripts and agents.

```sh
gumroad-pp-cli products list
gumroad-pp-cli products get product-id --json
gumroad-pp-cli sales list --email buyer@example.com --after 2026-01-01T00:00:00Z
gumroad-pp-cli sales get sale-id --json
gumroad-pp-cli subscribers list product-id
gumroad-pp-cli subscribers get subscriber-id --json
```

Pagination cursors are opaque. Pass a cursor returned by Gumroad back unchanged:

```sh
gumroad-pp-cli products list --page-key opaque-cursor --json
```

License verification is read-only by default. Incrementing a license use count is a separate command:

```sh
gumroad-pp-cli license verify --product-id product-id --license-key license-key --json
gumroad-pp-cli license increment-uses --product-id product-id --license-key license-key --yes
```

## Mutations and dry runs

Every mutation requires `--yes`. Use `--dry-run` to validate local arguments and print the intended request without authentication or network I/O; it does not require `--yes`.

```sh
gumroad-pp-cli products create --name "Example product" --price 500 --dry-run
gumroad-pp-cli products update product-id --name "Example product" --price 500 --yes
gumroad-pp-cli products delete product-id --dry-run
gumroad-pp-cli sales refund sale-id --amount-cents 250 --yes
gumroad-pp-cli sales resend-receipt sale-id --yes
gumroad-pp-cli sales mark-shipped sale-id --tracking-url https://carrier.example/track/123 --yes
```

Implemented product child-resource commands cover variants in an existing category, offer codes, custom fields, covers, and thumbnails. Inspect each command's local help for its required IDs and flags:

```sh
gumroad-pp-cli products variants create product-id category-id --name "Variant" --dry-run
gumroad-pp-cli products offer-codes create product-id --name SPRING --amount-off 100 --dry-run
gumroad-pp-cli products covers add product-id --url https://example.com/cover.png --dry-run
gumroad-pp-cli products thumbnails set product-id --signed-blob-id blob-id --dry-run
```

## Current limits

No live account verification is included in this repository. Payouts, tax data, subscription/webhook operations, OAuth browser/device authorization, variant-category management, and file uploads are deferred. Covers and thumbnails accept a remote URL or an already-created signed blob ID; this CLI does not upload files.

## Local checks

```sh
make check
```

`make check` formats Go files, runs the full test suite, runs `go vet`, builds the binary, and confirms that `gofmt` has no remaining output.

## License

MIT. See [LICENSE](LICENSE) and [NOTICE](NOTICE).