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

*attribute*

```python
Auth
```

Re-exported from: `ocx_sdk._types`

Credentials for one registry. `None` elsewhere means anonymous.

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

## ocx_sdk.BasicAuth

*class* · *dataclass*

```python
class BasicAuth
```

Re-exported from: `ocx_sdk._types`

Username and password for a registry.

> **Example**
>
> >>> BasicAuth("ci", "hunter2")
> BasicAuth(user='ci', password=***)

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

### ocx_sdk.BasicAuth.password

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

```python
password: str = field(repr=False)
```

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

### ocx_sdk.BasicAuth.user

*attribute* · *instance attribute*

```python
user: str
```

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

## ocx_sdk.BearerAuth

*class* · *dataclass*

```python
class BearerAuth
```

Re-exported from: `ocx_sdk._types`

A bearer token for a registry.

> **Example**
>
> >>> BearerAuth("ghp_secret")
> BearerAuth(token=***)

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

### ocx_sdk.BearerAuth.token

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

```python
token: str = field(repr=False)
```

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

## ocx_sdk.Channel

*class*

```python
class Channel(StrEnum)
```

Bases: `StrEnum`

Re-exported from: `ocx_sdk._types`

Release channel of the dist manifest.

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

### ocx_sdk.Channel.NEXT

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

```python
NEXT = 'next'
```

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

### ocx_sdk.Channel.STABLE

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

```python
STABLE = 'stable'
```

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