Repository navigation
0.8.0-preview.1
Pre-releaseThe first published release of the opencode v2 .NET SDK.
dotnet add package OpenCodeAI.Sdk --prerelease
dotnet add package OpenCodeAI.Sdk.Extensions --prerelease # dependency injection, optionalThe package id is not the namespace. You install
OpenCodeAI.Sdkand you writeusing OpenCode.Sdk;— nuget.org reserves theOpenCode.id prefix for an unrelated owner, so the artifact carries a different name than the code inside it.
What is in it
- 135 of the 140 operations in the pinned OpenAPI snapshot, across 28 client families. Three are declined by recorded decision and two are transport-owned WebSocket upgrades served by hand-written doors — none is missing by omission.
- Server-sent event streams, the global bus and the per-session log, as
IAsyncEnumerable<T>. - PTY and persistent-PTY terminal sessions over WebSockets, with consumer cancellation independent of connection lifetime and a configurable per-send deadline.
- A standalone server launcher:
OpenCodeServer.StartAsync()starts, monitors and stops a privateopencode2 servechild and hands back a client bound to it. - Dependency injection through
OpenCodeAI.Sdk.Extensions. - A typed error model with
NoThrow, cursor pagination, and source-generatedSystem.Text.Jsonwith no reflection fallback.
Targets netstandard2.0, net472, net8.0, net9.0, net10.0.
Scope
This SDK speaks the v2 protocol surface only — the line that installs as the opencode2 command. The 1.x surface is not a target.
Built against the accepted snapshot of upstream v2 at f9bc223. The exact commit and the receipt-governed refresh procedure live in spec/SNAPSHOT.md.
Pre-1.0. The public surface is locked by a reviewed baseline, but it may still move before 1.0.0.
Unofficial. Not affiliated with or endorsed by the opencode team.
Full notes: CHANGELOG.md