oneharness-sdk
Async Python access to the oneharness engine, generated from and validated against the Rust-owned JSON Schema contracts. The distribution is oneharness-sdk, the import is oneharness_sdk, and every release depends on the exact same oneharness-cli version.
pip install oneharness-sdk
import asyncio
from oneharness_sdk import OneHarness
async def main() -> None:
oneharness = OneHarness()
report = await oneharness.run(
{"prompt": "Summarize this repository", "harnesses": ["codex"]}
)
print(report["results"][0]["text"])
asyncio.run(main())
Every JSON-returning method passes --format json --compact itself, so the CLI's own default (a human-readable text view) never reaches the SDK. A run over several harnesses is a fallback chain by default — the first candidate that can run does, and the report's fallback block says which; pass "run_mode": "parallel" to run them all at once.
The client covers every verb the CLI exposes, so nothing needs a hand-built command line: run, run_mock, run_stream, list, detect, config, sync, init, usage, gate, mock, interrupt, history, history_list, history_watch, history_clear, history_migrate, and history_pointers. That coverage is gated, not asserted here. run_mock uses the deterministic responder shipped in the CLI; see Testing patterns. run_stream and history_watch are async iterators. Every envelope is validated before it is yielded; closing or cancelling an iterator terminates its subprocess.
An option whose name is a Python keyword takes the conventional trailing underscore — sync({"global_": True}) sends --global — and nothing else about the spelling changes.
async for envelope in oneharness.run_stream(
{"prompt": "Inspect this repository", "harnesses": ["codex"]}
):
if envelope["type"] == "event" and envelope["event"]["name"] == "shell":
break
async for envelope in oneharness.history_watch(
{"labels": {"graph": "release"}, "after": last_history_id}
):
print(envelope["record"]["history_id"])
Python input keys are snake case and strict: unknown fields and misspellings fail before the CLI starts. Output dictionaries preserve additive fields from newer compatible CLI versions. history and history_watch raise HistoryNotFoundError when a session, record, or cursor cannot be resolved.
Metadata
Release files for oneharness-sdk 0.19.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oneharness_sdk-0.19.1.tar.gz | 108.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oneharness_sdk-0.19.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 219.4 kB
Release files / oneharness_sdk-0.19.1.tar.gz
| Download URL | oneharness_sdk-0.19.1.tar.gz |
|---|---|
| Size | 108.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b91a274d9750d97f9a5a2aeae6318ca48273aec451211c2ea6b745fe25c4c39
|
|
BLAKE2b-256 checksum How to use checksums |
f9d2ebe883cb58918e30629f90ae118ddd1573b9fdeed9a9474c646c2115c8c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / oneharness_sdk-0.19.1-py3-none-any.whl
| Download URL | oneharness_sdk-0.19.1-py3-none-any.whl |
|---|---|
| Size | 110.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eef078e3b1cc184b00375dd343504f440c90b73db429fe6ff5b17708d66d973e
|
|
BLAKE2b-256 checksum How to use checksums |
643e299122a80ec0c9475cf9d36700d82fc850aab7146f3ed907944506041857
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency log