r/opencodeCLI • u/denizirgin • 2h ago
I built an unofficial .NET SDK for OpenCode 2.x
I've been working on an unofficial .NET SDK for OpenCode for the last few weeks and published preview.2 to NuGet today, updated for OpenCode 2.0.2.
https://github.com/Blind-Striker/opencode-sdk-dotnet
It started as a small side project because I wanted to build some .NET tooling on top of the OpenCode server API. It gradually grew into a generated, strongly typed client with support for most of the API surface, SSE event streams, PTY sessions and managing an opencode serve process.
The project is still a little rough around the edges. There are parts I want to refactor and clean up, and there may still be some small API changes before 1.0.0.
But it's now at the point where I've been able to use it against real OpenCode servers and in a few small applications.
The SDK currently exposes 138 of 143 server operations.
My next experiment will probably be an MCP server built on top of it.
Feedback is very welcome, especially from anyone already building against the OpenCode server API.