Skip to content

bacio api

Run a REST server that exposes the same surface as the CLI. Same inputs.*Input structs, same schemaRegistry, same validators, same audit log — only the transport differs.

bash
bacio api                                  # bind 127.0.0.1:5320, no auth
bacio api --addr 127.0.0.1:7777 --token T  # require Authorization: Bearer T
BACIO_API_TOKEN=T bacio api                # token via env

Flags

FlagDefaultWhat it does
--addr127.0.0.1:5320Bind address as host:port.
--portShorthand to override only the port (keeps host from --addr).
--tokenRequire Authorization: Bearer <token> on every request except /healthz (so liveness probes never need to know the token). Falls back to BACIO_API_TOKEN.

Plus all global flags. One caveat: the persistent --user flag is silently ignored under bacio api — incoming requests carry their own actor via the X-Actor header (default "api").

Once running, point any client at the server — or set BACIO_REMOTE so other bacio calls go through the API instead of the local DB:

bash
export BACIO_REMOTE=http://127.0.0.1:5320
export BACIO_API_TOKEN=
bacio issue list                 # now hits the API

See also

  • Run the API server — end-to-end guide with curl examples, endpoint mapping, error codes, and the --remote / --token CLI-client pairing.
  • JSON payloads — the same contract the HTTP API exposes.

bacio · v0.1 · MIT