Metadata-Version: 2.4
Name: commandlayer
Version: 1.1.0
Summary: CommandLayer Python SDK — semantic verbs, signed receipts, and verification helpers.
Author-email: CommandLayer <security@commandlayer.org>
License: MIT
Project-URL: Homepage, https://github.com/commandlayer/sdk
Project-URL: Repository, https://github.com/commandlayer/sdk
Project-URL: Documentation, https://github.com/commandlayer/sdk#readme
Project-URL: Changelog, https://github.com/commandlayer/sdk/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/commandlayer/sdk/issues
Keywords: commandlayer,agents,receipts,protocol-commons,ens,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0
Requires-Dist: pynacl>=1.5.0
Requires-Dist: web3>=6.20.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: ruff>=0.6.0; extra == "dev"
Requires-Dist: mypy>=1.10.0; extra == "dev"
Requires-Dist: build>=1.1.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"

# CommandLayer Python SDK

Official Python SDK for CommandLayer Commons v1.1.0.

The Python package mirrors the TypeScript SDK's protocol model:
- client methods return `{ "receipt": ..., "runtime_metadata": ... }`,
- the signed `receipt` is the canonical verification payload,
- `runtime_metadata` is optional execution context, and
- verification can use an explicit Ed25519 key or ENS discovery.

## Install

```bash
pip install commandlayer
```

Supported Python versions: 3.10+.

## Quick start

```python
from commandlayer import create_client, verify_receipt

client = create_client(actor="docs-example")
response = client.summarize(
    content="CommandLayer makes agent execution verifiable.",
    style="bullet_points",
)

print(response["receipt"]["result"]["summary"])
print(response["receipt"]["metadata"]["receipt_id"])
print(response.get("runtime_metadata", {}).get("duration_ms"))

verification = verify_receipt(
    response["receipt"],
    public_key="ed25519:BASE64_PUBLIC_KEY",
)
print(verification["ok"])
```

## Verification

```python
result = verify_receipt(
    response["receipt"],
    ens={
        "name": "summarizeagent.eth",
        "rpcUrl": "https://mainnet.infura.io/v3/YOUR_KEY",
    },
)
```

## Development

```bash
cd python-sdk
python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'
ruff check .
mypy commandlayer
pytest
```
