https://github.com/srid/opencode-haskell
Haskell client library for OpenCode
https://github.com/srid/opencode-haskell
Last synced: 20 days ago
JSON representation
Haskell client library for OpenCode
- Host: GitHub
- URL: https://github.com/srid/opencode-haskell
- Owner: srid
- License: mit
- Created: 2026-03-13T18:48:23.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2026-03-13T21:18:26.000Z (3 months ago)
- Last Synced: 2026-05-21T08:42:42.564Z (29 days ago)
- Language: Haskell
- Size: 17.6 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README
# opencode-haskell
[](https://hackage.haskell.org/package/opencode)
Haskell client library for [OpenCode](https://github.com/anomalyco/opencode) server API.
See the [OpenCode SDK docs](https://opencode.ai/docs/sdk/) for the full API reference.
## Usage
```haskell
import OpenCode
main :: IO ()
main = do
client <- mkClient "localhost" 4096
-- Check health
Right health <- getHealth client
-- Create session and send message
Right session <- createSession client Nothing (SessionCreateInput (Just "My Session") Nothing)
Right response <- promptSession client session.id Nothing (MessageInput [textPartInput "Hello!"])
-- Clean up
deleteSession client session.id Nothing
```
## Run example
```bash
just example
```
Or with custom server:
```bash
nix run .#example -- localhost:4096
```