# 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.LoginResult

*class* · *dataclass*

```python
class LoginResult
```

Re-exported from: `ocx_sdk._results`

`ocx login` — which registry, as whom.

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

### ocx_sdk.LoginResult.registry

*attribute* · *instance attribute*

```python
registry: str
```

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

### ocx_sdk.LoginResult.username

*attribute* · *instance attribute*

```python
username: str
```

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

### ocx_sdk.LoginResult.from_json

*method* · *classmethod*

```python
def from_json(raw: str) -> LoginResult
```

Parse `ocx --format json login` output.

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

## ocx_sdk.LogoutResult

*class* · *dataclass*

```python
class LogoutResult
```

Re-exported from: `ocx_sdk._results`

`ocx logout` — which registry. Always succeeds, even if nothing was stored.

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

### ocx_sdk.LogoutResult.registry

*attribute* · *instance attribute*

```python
registry: str
```

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

### ocx_sdk.LogoutResult.from_json

*method* · *classmethod*

```python
def from_json(raw: str) -> LogoutResult
```

Parse `ocx --format json logout` output.

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