Skip to main content

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, compact, history, history_list, history_watch, history_clear, history_migrate, history_reindex, and history_pointers. That coverage is gated, not asserted here, and this list is held to the same capability manifest by every_capability_is_named_in_each_sdk_readme in crates/sdk-conformance/tests/sdk_conformance.rs. 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.27.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oneharness-sdk 0.27.1
File Size Uploaded Provenance Actions
oneharness_sdk-0.27.1.tar.gz 124.1 kB With provenance Details for oneharness_sdk-0.27.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for oneharness-sdk 0.27.1
File Interpreter ABI Platform Actions
oneharness_sdk-0.27.1-py3-none-any.whl Python 3 none any Details for oneharness_sdk-0.27.1-py3-none-any.whl

Total release size: 249.7 kB

Release files / oneharness_sdk-0.27.1.tar.gz

Download URL oneharness_sdk-0.27.1.tar.gz
Size 124.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a9eb8381c23bcbbeea4e099d369c4490c229e2a283e2023858410d5696ee2222
BLAKE2b-256 checksum
How to use checksums
575a108038ef37f22407af6f76fd76cb8b649cd5ae8bcf90471caee524449d25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 4, 2026.

Transparency log

Release files / oneharness_sdk-0.27.1-py3-none-any.whl

Download URL oneharness_sdk-0.27.1-py3-none-any.whl
Size 125.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df0b76445f979fb4024f245372cf0cc9a4c7425e1f4824ebf09e0ccd4b4d4f60
BLAKE2b-256 checksum
How to use checksums
98c7dafd27c595ae7012d3e150e250d32f77abc19a5a38a3b7f647b172d1fb64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 4, 2026.

Transparency log

Security for oneharness-sdk 0.27.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for oneharness_sdk-0.27.1.tar.gz

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 Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.27.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page