# CLI

> talo-hub commands, environments and non-interactive use.

`npx talo-hub <command>` (Node 20+). `--json` for machine output (JSON on stdout, human messages on stderr), `--production` / `--sandbox` to pick the account, `TALO_HUB_API_KEY` to use a key without login.

Exit codes: 0 success; 1 any failure, including `doctor` when not ready and `webhooks test` when the endpoint didn't answer 2xx. With `--json`, failures print `{ "error": { "code", "message", "status" } }`.

## Login from an agent

`npx talo-hub login` waits until the person authorizes and then exits by itself (0 = connected): that exit is your signal, so don't ask them whether they authorized. Show them the link and code it prints; they compare the code in their browser. If your tool notifies you when a background command exits (Claude Code's background commands do), run it in the background and continue when that notice arrives; otherwise run it in the foreground with a timeout of at least 10 minutes. If it gets cut off, run the same command again: it picks up the same login, with the same link and code. If it expired, running it again checks once whether the person finished in Talo anyway (and collects the key), and otherwise starts a new login with a new link and code.

With `--json`, stderr carries one line `{"event":"waiting_for_authorization","login_url","user_code","expires_at","resumed"}` as soon as the login waits (again, with the new link and code, if it had to start over: use the last one), and stdout gets the result when it ends. The link and code last 10 minutes. `TALO_HUB_NO_BROWSER=1` skips opening the browser (the link is printed anyway).

- `talo-hub login [--production]`: Conecta tu cuenta Talo desde el navegador (sandbox por defecto). Termina solo cuando autorizás; si se cortó, correrlo de nuevo retoma el mismo login.
- `talo-hub logout [--production | --all]`: Revoca la key guardada en el hub y la borra de tu máquina.
- `talo-hub disconnect --yes [--production]`: Desconecta tu cuenta del hub: borra su copia de la autorización de Talo y revoca todas las keys y webhooks. Producción pide --production.
- `talo-hub use <sandbox|production>`: Elige el entorno de los próximos comandos.
- `talo-hub status`: Cuenta conectada, su estado y los permisos de la key.
- `talo-hub doctor`: Checklist para pasar a producción, con lo que falta (sale con 1 si falta algo).
- `talo-hub payments create --amount 15000 [--external-id] [--motive]`: Crea un pago y muestra el CVU, el alias y el snippet del widget para tu página.
- `talo-hub payments get <id>`: Estado de un pago.
- `talo-hub payments list [--from] [--to]`: Pagos de un período (30 días por defecto).
- `talo-hub payments refund <id> [--amount]`: Reembolso total o parcial.
- `talo-hub sandbox pay <id> [--amount]`: Simula la transferencia del comprador.
- `talo-hub links create --title <título> (--amount <ARS> | --min <ARS> --max <ARS>) [--description] [--redirect-url]`: Crea un link de pago reutilizable (precio fijo, o un rango en el que elige el comprador) y muestra su URL y la de su QR.
- `talo-hub links list | get <id> | disable <id>`: Tus links de pago, uno con los pagos que se crearon con él, o desactivarlo para siempre.
- `talo-hub events list [--payment <id>] [--type <tipo>] [--after <id>] [--limit]`: Eventos recientes, filtrables por cobro o tipo.
- `talo-hub events listen [--forward-to <url|puerto>]`: Recibe eventos en vivo y los reenvía a localhost, sin túneles.
- `talo-hub webhooks list | add <url> [--vercel <env> | --dotenv <archivo>] | remove <id> | test <id>`: Webhooks firmados: registrar (probando antes la URL), quitar y mandar un evento de prueba.
- `talo-hub keys list | create --name <nombre> [--scope] [--vercel <env> | --dotenv <archivo>] | revoke <id>`: Keys para tus proyectos (scope charge por defecto), guardadas en Vercel o en tu .env sin mostrarlas.
- `talo-hub balance, transactions [--from] [--to] [--limit] [--cursor]`: Saldo y movimientos (cuando Talo los habilite para partners).
- `talo-hub mcp [--client claude|cursor|desktop] [--with-key]`: Configuración del MCP lista para pegar: OAuth por defecto, o con tu key.
- `talo-hub skills list | install [--stack <kit>] [--global]`: Instala las skills de Talo en .claude/skills, con el kit del stack del proyecto.

---
Human page: https://talopartnerhub.vercel.app/docs/cli · All pages: https://talopartnerhub.vercel.app/docs/index.md
