opencode-rs-sdk
This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.
opencode-sdk
Rust SDK for OpenCode HTTP API with SSE streaming support. Provides ergonomic async client, 15 REST API modules, 40+ event types, and managed server lifecycle.
Use this file to understand the SDK structure, feature flags, and correct API usage patterns. All examples assume async context with tokio runtime.
Agent Operating Rules
- Always check feature flags before using APIs -
httpandsseare enabled by default,serverandclirequire explicit enabling. - Unix platforms only - Windows will fail at compile time with
compile_error!. - Subscribe before sending - For streaming workflows, create SSE subscription before sending async prompts to avoid missing early events.
- Use convenience methods - Prefer
Client::run_simple_text()andwait_for_idle_text()for common workflows. - Handle all error variants - Match on
OpencodeErrorvariants, using helper methods likeis_not_found()andis_validation_error(). - Drop subscriptions to cancel -
SseSubscriptionandRawSseSubscriptioncancel on drop; explicitly call.close()for early termination. - Server processes auto-kill -
ManagedServerkills child process on drop; call.stop()for graceful shutdown. - Directory header required - Most operations require
x-opencode-directoryheader set viaClientBuilder::directory()orManagedRuntimeBuilder::directory(). - URL encode path parameters - All path parameters must be URL-encoded using
urlencoding::encode()to handle special characters.
Environment and Version Constraints
More from alpha-innovation-labs/ratkit
ratkit
Comprehensive guide for the ratkit Rust TUI component library built on ratatui 0.29, including feature flags, APIs, and implementation patterns. Use when building, debugging, or extending ratkit applications and examples.
12nexus
Use this skill when working on Nexus context workflows, CDD specifications, or deriving reusable skills from repository code.
2software-enginering
This skill should be used every time you do software engineering
2