- integrations
- ocx-sdk
ocx-sdk
Run pinned developer tools from Python through typed methods, sync or async, with no runtime dependencies.
Install
Section titled “Install”ocx-sdk drives the ocx binary, so you need Python 3.12+ and
an ocx binary, either on PATH or fetched by bootstrap.ensure().
uv add ocx-sdkPre-1.0: the API may change between minor versions
Breaking changes ship without migration shims. Pin to a version, and watch the release notes.
Start with a task
Section titled “Start with a task”- Run your first pinned tool: install, get an ocx binary, pull a toolchain and run a tool from it.
- Run pinned tools from a script: pull a project’s toolchain and run its tools, or hand its environment to your own subprocess.
- Test against a pinned tool in pytest: one fixture, one locked project per test.
- Reproduce a toolchain in CI: bootstrap a pinned ocx, then fail the build when the lock drifts.
- Resolve for another platform: lock and pull for a target other than the host.
- Use the async API: run tools from asyncio without blocking.
- Replace a hand-rolled subprocess wrapper: map
subprocess.run(["ocx", ...])onto typed methods. - Fix an error: find the exception and the next step by exit code.
Look something up
Section titled “Look something up”- API reference: every public symbol, generated from docstrings.
- Command map: every ocx command and its SDK method.
- Environment and exit codes: every variable the SDK reads or writes.
- Why a wrapper: why the SDK drives the CLI instead of reimplementing it.