Language bindings
snapdir ships official bindings for six languages plus a native Rust API. Every
binding wraps the same Rust core, so the manifests and snapshot IDs they produce
are bit-identical to the CLI — a <snapshot-id> computed in Node, Python, or Go
is the exact 64-character lowercase hex string you get from snapdir id.
The surface is the same everywhere: synchronous id / manifest, plus async
push / pull / fetch / diff / sync, expressed in each language's idiom.
Errors share one stable 8-code taxonomy — IO_ERROR, HASH_MISMATCH,
STORE_ERROR, IN_FLUX, CATALOG_ERROR, INVALID_ID, INVALID_STORE, and
CONFLICT — so error handling ports cleanly from one language to the next.
Choose your language
Two install shapes
Bindings come in two flavors depending on how the native code is delivered:
-
Prebuilt, zero-compiler — Node, Python, and Java ship precompiled native binaries in their published packages. Install from the registry and you are done; no Rust toolchain or C compiler required.
-
Build-from-source — C/C++, Zig, and Go build against the
snapdir-ffiC ABI. You compile thesnapdir-fficrate (from crates.io) and generate its header withcbindgen, then link your program against it. A Rust toolchain and a C toolchain are required.
Platform support
Every binding is CI-verified against its live public registry before release.
All bindings run on Linux (glibc and Alpine/musl, x64 and arm64) and macOS. The one exception is Java, which is glibc-only today — musl support is planned for 1.11.1. Windows is unsupported: snapdir is Unix-only.