Go SDK for the Codex app-server WebSocket JSON-RPC protocol.
Types are generated from the Codex JSON Schema using a custom codegen script.
import "github.com/tta-lab/codex-server-go/protocol"
// Use method constants
method := protocol.MethodThreadStart
// Use typed params
params := protocol.ThreadStartParams{
Cwd: &cwd,
Model: &model,
}
// Unmarshal server notifications
var notif protocol.ServerNotification
json.Unmarshal(data, ¬if)
switch notif.Method {
case protocol.NotifItemAgentMessageDelta:
p, _ := notif.ItemAgentMessageDeltaParams()
fmt.Println(p.Delta)
}# Regenerate types from schema
make generate
# Run all CI checks
make ci- Copy the updated schema to
schema/codex_app_server_protocol.schemas.json - Run
make generate - Run
make cito verify