Skip to main content
The Bachs CLI is a single binary that talks to the same API your server does. It pairs with your account through the browser, forwards live webhook events to a port on your machine, and exposes every API operation as a command, so you can inspect and change your integration without writing a request by hand. It is one static binary with no runtime to install first, whatever language your application is written in.

Install

You can also download a build for your platform from the releases page. Debian and RPM packages are published there too. Check what you have:
Confirm the install

Log in

bachs login prints a short code, opens your browser, and waits. Approve the request in the dashboard and the CLI receives its credentials.
Connect this machine
Response
Check that the code on the approval screen matches the one in your terminal before approving. That match is what ties the request to this machine. Pairing writes a key to ~/.config/bachs/config.json with owner-only permissions. It is separate from the keys you create by hand, so you can revoke it from the developer portal without touching your server’s credentials. Add --sandbox to pair against the sandbox rather than production:
Pair against sandbox
In CI, or on a machine with no browser, set BACHS_API_KEY in the environment instead. Avoid bachs login --api-key: a key passed on the command line is written to your shell history and is readable by other local users through the process list.

What you can do

Forward events to localhost

Receive live webhook events on your own machine while you build. No public URL and no tunnel.

Emit a sample event

Exercise your handler without making a real payment. Sandbox only.

Inspect and replay events

List recent events with how their delivery went, and redeliver the ones that failed.

Call any API operation

Every endpoint in the API is a command, from bachs customers list to bachs payouts get.

Environments

Your stored credentials decide which environment the CLI talks to. bachs login pairs against production by default, and bachs login --sandbox pairs against the sandbox.
Check which one you are on
Response
When you pass a key yourself, the prefix selects the environment: sk_sandbox_ targets the sandbox and sk_live_ targets production. There is no separate flag to keep in step with the key you are using. Build against the sandbox first. Going live is a key swap, not a code change.

Configuration

Credentials resolve in this order, so a one-off command can target another account without disturbing what you have stored: Two environment variables change where things go:
  • BACHS_API_KEY supplies credentials without a config file.
  • BACHS_CONFIG_DIR moves the config file somewhere other than ~/.config/bachs.

Next steps