This document defines how developers should experience CommandLayer — from install to first receipt — and the principles guiding SDK design decisions.
The goal is simple:
Zero friction to first successful, verifiable receipt.
CommandLayer Commons verbs are:
- Strictly schema-defined
- Deterministic where possible
- Receipt-producing
- Cryptographically verifiable
Developers should never wonder:
- What shape is this request?
- What does this response contain?
- Can I verify this output later?
The SDK exists to eliminate ambiguity.
Every SDK method returns a receipt object, not just output.
Example:
const receipt = await client.summarize({
content: "Long text...",
style: "bullet_points"
});
console.log(receipt.result);
console.log(receipt.metadata.proof.hash_sha256);Why?
Because CommandLayer is not just execution — it is evidence.
Verification should be:
- Available
- Simple
- Optional
- Explicit
Developers can:
- Verify using a provided public key (offline)
- Resolve signer pubkey from ENS (online)
- Skip verification entirely (if desired)
The SDK must not silently perform network verification without consent.
npm install @commandlayer/sdkBasic usage:
import { createClient } from "@commandlayer/sdk";
const client = createClient({
runtime: "https://runtime.commandlayer.org"
});pip install commandlayer-sdkBasic usage:
from commandlayer import create_client
client = create_client(runtime="https://runtime.commandlayer.org")The "Hello World" of CommandLayer:
const receipt = await client.summarize({
content: "CommandLayer standardizes agent verbs.",
style: "bullet_points"
});
console.log(receipt.result.summary);Expected:
- A valid structured result
- A signed receipt
- A verifiable hash
Each Commons verb is a top-level method:
client.summarize(...)
client.analyze(...)
client.classify(...)
client.fetch(...)
client.convert(...)No nested namespaces. No magic proxies.
Clarity over cleverness.
4.2 No Hidden Global State
The client instance holds configuration:
const client = createClient({
runtime: "...",
actor: "...",
verifyReceipts: true
});No singleton. No global mutation.
Default runtime:
https://runtime.commandlayer.org
But developers may override:
createClient({
runtime: "https://my-runtime.internal"
});The SDK should not hard-code execution endpoints.
CommandLayer receipts contain:
- Structured result
- Canonicalized hash
- Ed25519 signature
- Signer identity
Verification modes:
verifyReceipt(receipt, {
publicKey: "...pem..."
});Works offline.
verifyReceipt(receipt, {
ens: true,
rpcUrl: "https://mainnet.infura.io/v3/..."
});Resolves:
cl.receipt.pubkey_* TXT record
This anchors signer identity to ENS.
The SDK may:
- Attempt ENS resolution
- Fall back to provided public key
- Fail clearly if neither is available
This provides:
- Decentralized trust anchor
- Operational resilience
The CLI mirrors SDK behavior.
Example:
commandlayer summarize \
--content "Test text" \
--style bullet_points \
--jsonCLI expectations:
- Always outputs valid JSON when
--jsonis passed - Human-readable output by default
- Never hides errors
The CLI is:
- A smoke test tool
- A reproducibility tool
- A receipt inspector
Errors must be:
- Structured
- Predictable
- Transparent
SDK errors include:
{
statusCode: 400,
message: "summarize.input.content required",
details: {...}
}No silent failures. No swallowed verification errors.
Recommended flow:
npm install
npm run build
node bin/cli.js summarize --content "test" --jsonDefinition of working local SDK:
- Build succeeds
- CLI returns receipt JSON
- No runtime crashes
- No syntax errors
The SDK must:
- Avoid schema compilation during hot paths
- Cache validators
- Avoid blocking verification by default
- Allow disabling receipt verification
Verification should not cause production latency spikes.
We follow SemVer:
- Patch → bug fixes
- Minor → new verbs/options
- Major → breaking changes
The SDK must not:
- Change receipt shapes silently
- Alter canonicalization rules
- Break verification logic without version bump
The SDK does NOT:
- Define new verbs
- Modify schemas
- Change receipt canonicalization rules
- Override runtime security policy
- Perform business logic
It is a transport + validation layer.
A developer can:
- Install SDK in under 60 seconds
- Make a successful call in under 2 minutes
- Verify a receipt in under 5 minutes
- Understand the receipt structure without reading the runtime source
If any of those fail, DX needs improvement.
CommandLayer SDKs should become:
- The standard client layer for agentic infrastructure
- The simplest way to produce verifiable execution artifacts
- A reference implementation of semantic API contracts
The SDK is not just a client.
It is the interface between:
- Intent
- Execution
- Evidence
- Trust