# ocx_sdk

*module*

Python SDK for [OCX](https://github.com/ocx-sh/ocx).

`ocx-sdk` drives the ocx binary rather than reimplementing it: ocx owns
resolution, verification, and the identifier grammar, and this package gives
you typed, CWD-independent handles over the commands it exposes.

```python
from ocx_sdk import Ocx, bootstrap

ocx = Ocx(exe=bootstrap.ensure())
project = ocx.project("/srv/build")
project.pull()
project.exec(["task", "verify"])
```

**This module is the API.** Everything listed in `__all__` is the stable
surface; every other module is underscored and package-private, and the one
public submodule is `ocx_sdk.bootstrap`. Reaching into an underscored path
means the next release may move it without notice — pre-1.0, breaking
changes ship without shims.

Start at `Ocx` for the runtime API and `bootstrap.ensure` for provisioning.

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/__init__.py#L1-L1)

## ocx_sdk.ExitCode

*class*

```python
class ExitCode(IntEnum)
```

Bases: `IntEnum`

Re-exported from: `ocx_sdk._errors`

Exit codes ocx assigns to error categories (`sysexits.h` plus ocx's own).

`TEMP_FAIL` is the retry signal — ocx maps 429/5xx/network timeouts onto
it, while `UNAVAILABLE` marks a failure that retrying cannot fix.

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_errors.py#L28-L51)

### ocx_sdk.ExitCode.CONFIG

*attribute* · *class attribute* · *instance attribute*

```python
CONFIG = 78
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_errors.py#L43-L43)

### ocx_sdk.ExitCode.DATA_ERR

*attribute* · *class attribute* · *instance attribute*

```python
DATA_ERR = 65
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_errors.py#L38-L38)

### ocx_sdk.ExitCode.DIRTY_RC_BLOCK

*attribute* · *class attribute* · *instance attribute*

```python
DIRTY_RC_BLOCK = 82
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_errors.py#L47-L47)

### ocx_sdk.ExitCode.FAILURE

*attribute* · *class attribute* · *instance attribute*

```python
FAILURE = 1
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_errors.py#L36-L36)

### ocx_sdk.ExitCode.FORGE_CAPABILITY_UNAVAILABLE

*attribute* · *class attribute* · *instance attribute*

```python
FORGE_CAPABILITY_UNAVAILABLE = 86
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_errors.py#L51-L51)

### ocx_sdk.ExitCode.IO_ERR

*attribute* · *class attribute* · *instance attribute*

```python
IO_ERR = 74
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_errors.py#L40-L40)

### ocx_sdk.ExitCode.NOT_FOUND

*attribute* · *class attribute* · *instance attribute*

```python
NOT_FOUND = 79
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_errors.py#L44-L44)

### ocx_sdk.ExitCode.NO_PERM

*attribute* · *class attribute* · *instance attribute*

```python
NO_PERM = 77
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_errors.py#L42-L42)

### ocx_sdk.ExitCode.OK

*attribute* · *class attribute* · *instance attribute*

```python
OK = 0
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_errors.py#L35-L35)

### ocx_sdk.ExitCode.POLICY_BLOCKED

*attribute* · *class attribute* · *instance attribute*

```python
POLICY_BLOCKED = 81
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_errors.py#L46-L46)

### ocx_sdk.ExitCode.REFERRERS_UNSUPPORTED

*attribute* · *class attribute* · *instance attribute*

```python
REFERRERS_UNSUPPORTED = 84
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_errors.py#L49-L49)

### ocx_sdk.ExitCode.TEMP_FAIL

*attribute* · *class attribute* · *instance attribute*

```python
TEMP_FAIL = 75
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_errors.py#L41-L41)

### ocx_sdk.ExitCode.TRANSPARENCY_LOG_UNAVAILABLE

*attribute* · *class attribute* · *instance attribute*

```python
TRANSPARENCY_LOG_UNAVAILABLE = 83
```

[View source](https://github.com/ocx-sh/ocx-sdk-python/blob/main/src/ocx_sdk/_errors.py#L48-L48)
