Configuration
Environment variables, exit codes, and JSON output — everything you need to wire snapshotdb into a script, CI job, or agent.
Environment variables
| Variable | Meaning |
|---|---|
SNAPSHOTDB_SERVER | Server base URL the client submits jobs to. Required — the client fails without it. |
SNAPSHOTDB_TOKEN | Admin token, sent as Authorization: Bearer. |
SNAPSHOTDB_CONSOLE_ORIGINS | Comma-separated exact browser origins allowed to call the control API. No wildcards; disabled by default. |
SNAPSHOTDB_HOME | Server storage directory (default ~/.snapshotdb). Put it on a reflink-capable volume. |
SNAPSHOTDB_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-urlprints only the connection URL, nothing else. Treat an empty result as a hard failure — do not fall back to another database.--format jsonprints a stable object with aschema_version; errors come back as{"error": "…"}.--detachreturns a job id immediately;snapshotdb job <id>reconnects. A long clone keeps running server-side after the client disconnects.