Skip to main content
Run bachs with no arguments to see the command list, or bachs <command> --help for the flags on any one of them. Every command accepts --api-key to override your stored credentials for that invocation. It is left out of the tables below to keep them readable.

login

Pairs this machine with your account through the browser. See Log in for the full flow.
Connect this machine
--api-key puts a credential in your shell history, and on Linux it is readable by other local users through the process list. Prefer the browser flow, or BACHS_API_KEY where no browser is available.

whoami

Shows which environment your stored credentials target. Useful before running anything that changes data.
Check the active environment
Response

listen

Forwards live events to a port on your machine. The connection is opened outbound, so there is no public URL and no tunnel. See Test webhooks locally for the full guide.
Forward every event
The target accepts the shapes people actually type. localhost:3000/webhooks, :3000/webhooks, and a full URL all work.
Forward two event types
Pass either --events or --all, not both. The CLI refuses rather than silently preferring one, so a filter you passed never does nothing without telling you.

trigger

Emits a sample event so you can exercise a handler without making a real payment. The event goes through the ordinary delivery path, so it fans out to whatever is subscribed, records delivery attempts, and is signed like any other event.
Emit a sample event
Sandbox only. A fake collection.succeeded in production could have you fulfil an order nobody paid for, so the CLI refuses rather than warning. In production, use bachs events replay to redeliver a real past event.
The event type is a positional argument. These are supported:

events

Lists past events and redelivers them. Replay is a plain API call, so it needs no forwarding session and works against your registered destinations in production too.

events list

Recent events and how they went
--undelivered is the one to reach for when an event seems to have vanished. It shows events that matched no destination at all, which usually means the endpoint filter does not include that type.

events replay

Redeliver one event

events replay-failed

Redelivers events whose delivery failed, which saves replaying them one at a time after an outage on your side.
See what would be replayed
Run --dry-run first. It costs nothing and tells you exactly what the real run will touch.

endpoints

Manages the webhook destinations Bachs delivers to. These are the same destinations shown in the Developer Portal.
Your webhook destinations
Register a destination
Remove a destination

Resource commands

Every API operation is also a command, grouped by resource. Run a resource name on its own to see its operations:
See what you can do with customers
Operations
The available resources:
accounts
balances
checkout-sessions
connected-accounts
conversions
customer-sessions
customers
disputes
media
misc
payments
payouts
persons
platform-fees
product-groups
products
reference
refunds
subscriptions
transfers
webhooks
Operations follow the API. Anything the operation takes in its path is a positional argument, and everything else is a flag:
Retrieve one customer
List with a filter
You do not have to know whether a value belongs in the query string or the request body. A flag the operation lists as a query parameter is sent as one, and anything else becomes a body field:
Create a customer
Values are converted to the JSON type the API expects. true and false become booleans, whole numbers become integers, and anything containing a decimal point is left as a string, so an amount like 29.00 stays exact rather than being rounded through a float. Responses print as formatted JSON, which pipes cleanly into jq:
Pull one field out of the response
Resource commands read and write real data in whichever environment you are paired with. Run bachs whoami first if you are not sure, and prefer bachs login --sandbox while you are exploring.

Exit codes

Scripts should check for a non-zero exit rather than parsing output, which is formatted for people and may change.