ReferenceConfiguration
Environment variables, exit codes, and JSON output — everything you need to wire anybranch into a script, CI job, or agent.
Environment variables
| Variable | Meaning |
|---|
ANYBRANCH_SERVER | Server base URL the client submits jobs to. Required — the client fails without it. |
ANYBRANCH_TOKEN | Admin token, sent as Authorization: Bearer. |
ANYBRANCH_HOME | Server storage directory (default ~/.anybranch). Put it on a reflink-capable volume. |
ANYBRANCH_IDLE_MINUTES | Idle timeout before a branch suspends (default 5; 0 never suspends). |
Exit codes
| Code | Meaning |
|---|
0 | Success. |
1 | Something failed while running — network, engine, timeout. |
2 | The command was wrong, or preflight did not pass. |
JSON and scripting
--print-url prints only the connection URL, nothing else. Treat an empty result as a hard failure — do not fall back to another database.--format json prints a stable object with a schema_version; errors come back as {"error": "…"}.--detach returns a job id immediately; anybranch job <id> reconnects. A long clone keeps running server-side after the client disconnects.