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

The TypeScript SDK exposes three modules on the Ship client:

ModuleMethodsWhat it does
attestaction, decision, approval, handoffSign an attestation (endorsement and typed receipt attestations are CLI-only for now: treeship attest endorsement / treeship attest receipt)
verifyverify, verifyReceipt, verifyCertificate, crossVerifyVerify a local artifact via the CLI; verify receipts/certificates in-process via @treeship/verify
hubpush, pull, statusUpload an artifact to the Hub, pull a remote one, check connection status

The Python SDK maps the same operations to flat snake_case methods: attest_action, attest_approval, attest_handoff, attest_decision, verify, hub_push, wrap, session_report.

The TypeScript SDK is the reference implementation; new methods land there first and propagate to Python and the bridges. Anything the SDKs don't wrap yet is still reachable by shelling out to the CLI directly.

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 }
result = ts.attest_action(actor="agent://x", action="tool.call")
print(result.artifact_id)

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