hishamkaram

Codex Agent SDK Go — Development skill for Claude Code

Development community

Go SDK for the OpenAI Codex CLI app-server transport with JSON-RPC 2.0, typed events, approvals, MCP config, and structured output.

How to install Codex Agent SDK Go

This entry records only its repository, not the path inside it, so there is no exact command to give. Open hishamkaram/codex-agent-sdk-go and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Codex Agent SDK Go does

Go SDK for the OpenAI Codex CLI app-server transport with JSON-RPC 2.0, typed events, approvals, MCP config, and structured output.

Alternatives in Development

  • Dario — A local OpenAI- and Anthropic-compatible proxy that brings your Claude Pro/Max subscription to Cursor, Cline 485 ★
  • Acp Go SDK — Go SDK for the Agent Client Protocol (ACP), offering typed requests, responses, and helpers so Go applications 226 ★
  • Claude Code SDK TS — Configure models, enable tools, stream events, then fetch text, JSON, run details or token stats in one call v 206 ★

README

Codex Agent SDK for Go

[![Go 1.25](https://img.shields.io/badge/Go-1.25-00add8?logo=go&logoColor=white)](https://go.dev/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

Go SDK for the OpenAI Codex CLI **app-server** transport — spawns `codex app-server` as a child process, speaks JSON-RPC 2.0 over stdio, and exposes a typed Go API for threads, turns, provider-created child activity, streaming events, approvals, background terminals, and MCP configuration.

**Status**: preview (`v0.x`). API may change before `v1.0.0`. Feedback welcome.

Sibling SDK: [`claude-agent-sdk-go`](https://github.com/hishamkaram/claude-agent-sdk-go) does the same thing for the Claude Code CLI.

Why this SDK?

Codex's app-server exposes a JSON-RPC 2.0 protocol over stdio — bidirectional, stateful, with server-initiated approval requests. Consuming it directly means handling line-framing with a 2 MiB minimum buffer, demultiplexing three request shapes (responses, notifications, server-initiated requests), serializing concurrent turns to preserve event boundaries, and mapping schema-covered notification methods to typed Go events. This SDK handles all of that and exposes a clean, typed API.

Feature matrix

Feature Status on current mainline
codex app-server transport
codex exec --json one-shot ❌ deferred to v2
Thread start / resume / fork / archive / list
thread.Run() (buffered) + thread.RunStreamed() (channel)
Streaming events: turn/item lifecycle, token usage, thread lifecycle/goals, process output, model/account/warning events, hooks, realtime, and unknown-event fallback
ThreadItem variants: agentMessage, userMessage, commandExecution, fileChange, mcpToolCall, webSearch, memoryRead/Write, plan, reasoning, subAgentActivity, systemError
Input variants: text, localImage
Sandbox modes: read-only, workspace-write, danger-full-access
Approval policies: untrusted, on-