Metadata-Version: 2.5
Name: cli-anything-brissoto-pay
Version: 1.1.2
Summary: Set apps up in the Brissoto Pay gateway from a coding agent.
Project-URL: Documentation, https://pay.brissoto.com/docs
License-Expression: MIT
Requires-Python: >=3.10
Requires-Dist: click>=8.1
Requires-Dist: convex>=0.8
Description-Content-Type: text/markdown

# cli-anything-brissoto-pay

Sets an app up in the Brissoto Pay gateway, from a coding agent or by hand: its servers, keys, webhook, return URLs, payment methods, branding, App Store and Google Play products, then go live. Admins, and Developers in Test.

## Install

On [PyPI](https://pypi.org/project/cli-anything-brissoto-pay/). Needs [uv](https://docs.astral.sh/uv/):

```sh
brew install uv
uvx cli-anything-brissoto-pay@latest --help
```

`uvx` runs it without installing anything in the project; `@latest` takes the newest release, not a cached one. `--version` says which one runs. Always on your PATH instead: `uv tool install cli-anything-brissoto-pay`, then `cli-anything-brissoto-pay …`.

## With a coding agent

1. Open [pay.brissoto.com/docs](https://pay.brissoto.com/docs), click **Copy prompt** on "Set up with a coding agent".
2. Paste it into your coding agent (Claude Code, Codex, Cursor) in the app's project.
3. Approve the sign-in in your browser, then answer its questions.

It starts in test and asks you before replacing a key, changing anything live, or going live.

## By hand

```sh
uvx cli-anything-brissoto-pay@latest login                       # approve in the browser, 30 days
uvx cli-anything-brissoto-pay@latest apps create --name Heyama --color "#0F766E" --language fr
uvx cli-anything-brissoto-pay@latest apps get heyama              # the Dev server's id
uvx cli-anything-brissoto-pay@latest servers update <server> --webhook-url https://api.heyama.com/webhooks/pay --return-url http://localhost:3000/paid
uvx cli-anything-brissoto-pay@latest servers key <server>
uvx cli-anything-brissoto-pay@latest servers webhook-secret <server>
uvx cli-anything-brissoto-pay@latest webhooks test <server>
uvx cli-anything-brissoto-pay@latest go-live heyama --webhook-url https://api.heyama.com/webhooks/pay --return-url https://heyama.com/paid --yes
```

Put the key and secret in `BRISSOTO_PAY_API_KEY` and `BRISSOTO_PAY_WEBHOOK_SECRET`, in an env file that is not committed.

## Commands

| Command                                                                                                                              | Does                                             |
| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------ |
| `login`, `logout`, `whoami`                                                                                                          | Sign in (browser), out, who and which role       |
| `skill`                                                                                                                              | The coding agent's setup guide                   |
| `apps list`                                                                                                                          | Every app                                        |
| `apps get <slug>`                                                                                                                    | One app, its servers, URLs and key hints         |
| `apps create --name --color --language [--logo]`                                                                                     | A Test app with a Dev server                     |
| `apps branding <slug> [--name] [--color] [--language] [--logo] [--terms-url] [--privacy-url] [--support-email] [--support-whatsapp]` | What payers see of it                            |
| `apps settings <slug> [--env] [--link-expiry] [--max-attempts] [--receipt-emails] [--yes]`                                           | Checkout settings of one environment             |
| `servers add <slug> <name>`                                                                                                          | A test server                                    |
| `servers update <server> [--webhook-url] [--return-url ...] [--yes]`                                                                 | Its URLs; the return URLs given replace the list |
| `servers key <server> [--yes]`                                                                                                       | Its API key, shown once                          |
| `servers webhook-secret <server> [--yes]`                                                                                            | Its webhook secret, shown once                   |
| `methods list [--env] [--app]`                                                                                                       | Payment methods and their providers              |
| `methods set <slug> <method> --on\|--off [--env] [--yes]`                                                                            | Offer a method, or not                           |
| `webhooks test <server> [--wait]`                                                                                                    | Send a `webhook.test`, say how it went           |
| `payments list <slug> [--env] [--days] [--status] [--page]`                                                                          | The app's payments                               |
| `payments get <id>`                                                                                                                  | One payment, its attempts and webhooks           |
| `go-live <slug> --webhook-url --return-url ... --yes`                                                                                | Production server, live key and secret           |
| `stores get <slug> [--env]`                                                                                                          | The store keys to give, what is saved            |
| `stores save <slug> --key NAME=VALUE --key-file NAME=PATH`                                                                           | App Store and Google Play on, in Test            |
| `stores check <slug> [--env]`                                                                                                        | Whether IAPKit and both stores take the keys     |
| `stores go-live <slug> [--key ...] [--key-file ...] --yes`                                                                           | The stores live, with their live keys            |
| `products list <slug> [--env] [--page] [--refresh]`                                                                                  | Store products, where each store stands          |
| `products add <slug> <id> --name --amount --currency`                                                                                | A product pushed to both stores                  |
| `products edit <slug> <id> [--name] [--amount] [--currency]`                                                                         | Change it, push again                            |
| `products retry <slug> <id>`                                                                                                         | Push again where it failed                       |
| `products prices <slug> [--env] [--page] [--read-now]`                                                                               | Store prices by country; read Test's now         |

Replacing a key or secret, any change in Live, and going live fail with `confirmation_required` without `--yes`.

No command opens the REPL. Every command takes `--json` and `--help`.

| Option         | Env var                   | Default                  |
| -------------- | ------------------------- | ------------------------ |
| `--gateway`    | `BRISSOTO_PAY_GATEWAY`    | `prod`                   |
| `--convex-url` | `BRISSOTO_PAY_CONVEX_URL` | the gateway's Convex URL |
| `--web-url`    | `BRISSOTO_PAY_WEB_URL`    | the gateway's dashboard  |

| Gateway | Convex URL                             | Dashboard                  |
| ------- | -------------------------------------- | -------------------------- |
| `prod`  | `https://api-pay.brissoto.com`         | `https://pay.brissoto.com` |
| `dev`   | `https://giant-bison-875.convex.cloud` | `http://localhost:4310`    |

`dev` is disabled since 2026-11-07 (spending limit, ADR 0002): point `--convex-url` at a local backend.

Sessions: `~/.config/brissoto-pay/sessions.json`, one per Convex URL.

## Develop

```sh
npm run test:cli
uv run --directory cli cli-anything-brissoto-pay --help
```
