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
TypeScript / Node.js
@treeship/sdk on npm. Full attest, verify, hub. The primary SDK for Node, Bun, Deno.
Python
treeship-sdk on PyPI. Full attest, verify, session reporting, hub.
Browser / WASM verifier
@treeship/verify and @treeship/core-wasm. Verify receipts entirely in the browser; no CLI required.
MCP / A2A bridges
@treeship/mcp and @treeship/a2a — drop-in instrumenters for any MCP-speaking agent.
Common shape
Every SDK exposes the same three modules, with the same method names mapped to the language's conventions:
| Module | Methods | What it does |
|---|---|---|
attest | action, decision, approval, handoff, endorsement, receipt | Sign one of the six attestation types |
verify | verify, verifyChain, verifyPackage | Recompute Merkle, recheck signatures, walk parent chain |
hub | push, pull, share | Upload 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
| Stack | Install |
|---|---|
| Node / TypeScript | npm install @treeship/sdk |
| Python | pip install treeship-sdk |
| Rust (library, not the CLI) | cargo add treeship-core |
| Browser verifier | npm install @treeship/verify @treeship/core-wasm |
| MCP bridge | npm install @treeship/mcp |
| A2A bridge | npm 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
- install + registry topology — what's on each registry and why
- Quickstart — the fastest path from
treeship initto a verified receipt - CLI reference — every command the SDKs wrap