Metadata-Version: 2.3
Name: opencode-sdk
Version: 0.1.0
Summary: Python client for opencode server API
Keywords: opencode,ai,agent,client,sdk
Author: Fergus Fettes
Author-email: Fergus Fettes <fergusfettes@gmail.com>
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: httpx>=0.28.0
Requires-Python: >=3.10
Project-URL: Homepage, https://github.com/fergusfettes/opencode-client
Project-URL: Repository, https://github.com/fergusfettes/opencode-client
Description-Content-Type: text/markdown

# opencode-client

Python client for [opencode](https://github.com/sst/opencode) server API.

## Installation

```bash
pip install opencode-client
```

## Usage

```python
from opencode_client import OpencodeClient

# Create client (defaults to http://localhost:36000)
client = OpencodeClient()

# Or specify custom URL
client = OpencodeClient(base_url="http://localhost:8000")

# List sessions
sessions = client.list_sessions()

# Send message to session (by ID or title)
response = client.send_message("headless-1", "hello world")

# Get session info
session = client.get_session("ses_abc123")

# Create new session
new_session = client.create_session(title="My Session")

# List messages
messages = client.list_messages("headless-1")
```

## Environment Variables

- `OPENCODE_SERVER` - Override default server URL (default: `http://localhost:36000`)

## License

MIT
