A minimal Go library for managing OpenCode server instances. Provides a simple API for starting, stopping, and monitoring isolated OpenCode servers with custom configurations.
See cmd/example/main.go for a complete working example demonstrating server lifecycle management.
New(cfg Config)- Create a new OpenCode instanceStart()- Start an isolated OpenCode server instanceStop()- Stop the OpenCode serverAddr()- Get the server address (host:port)WaitForReady(maxAttempts int)- Wait for the server to become ready
type Config struct {
ConfigDir string // Directory for OpenCode config and data
Addr string // Server address (auto-allocated if empty)
APIKey string // API key for authentication
}