Treeship
SDK

SDK overview

Treeship's SDKs — pick the language that matches your stack. Every SDK shells out to the same signed CLI binary.

Treeship ships an SDK for the languages most agent stacks are built in. Every SDK is a thin wrapper over the same treeship CLI binary — the binary does the signing, verification, and Hub I/O; the SDK just gives you idiomatic types and async ergonomics in your language. That keeps the trust surface (Ed25519 signing, canonical PAE, Merkle compose) in one place across every language and platform.

Install the CLI first. Every SDK requires the treeship binary on PATH and a treeship init workspace. See install + registry topology for the full picture of which package goes on which registry, and what's intentionally not on each one.

Pick your SDK

Common shape

Every SDK exposes the same three modules, with the same method names mapped to the language's conventions:

ModuleMethodsWhat it does
attestaction, decision, approval, handoff, endorsement, receiptSign one of the six attestation types
verifyverify, verifyChain, verifyPackageRecompute Merkle, recheck signatures, walk parent chain
hubpush, pull, shareUpload to the Hub, get a shareable URL, pull a remote receipt

The TypeScript SDK is the reference implementation; new methods land there first and propagate to Python and the bridges.

Install topology

StackInstall
Node / TypeScriptnpm install @treeship/sdk
Pythonpip install treeship-sdk
Rust (library, not the CLI)cargo add treeship-core
Browser verifiernpm install @treeship/verify @treeship/core-wasm
MCP bridgenpm install @treeship/mcp
A2A bridgenpm install @treeship/a2a
CLI binary (native)npm install -g treeship or download a GitHub Release binary

The CLI is not on crates.io. treeship-cli is a binary distributed via npm + GitHub Releases; only the treeship-core library is on crates.io. See install + registry topology for the full rationale (Rust binaries with native deps don't ship cleanly on crates.io; native deps shell out from the SDK boundary anyway).

Agent-mode shape

Every SDK supports a JSON output mode the underlying CLI inherits via --format json. AI agents calling the SDK can:

const result = await s.attest.action({ actor: 'agent://x', action: 'tool.call' });
//   ^? { artifactId: string, digest: string, signedAt: string }
result = ts.attest_action(actor="agent://x", action="tool.call")
print(result.artifact_id, result.digest)

The shape is stable across SDKs — agents that orchestrate Treeship through one language can hand the same JSON to a verifier in another.

See also