whatisgithub

What is agent-wrapper?

smallnest/agent-wrapper — explained in plain English

Analysis updated 2026-05-18

28GoAudience · developerLicense

In one sentence

A Go library that gives you one consistent interface for driving Claude Code, Cursor, Codex, and other coding-agent CLIs from your own programs.

Mindmap

mindmap
  root((agent-wrapper))
    Problem
      Each CLI is different
      No shared interface
    Core pieces
      Agent interface
      Registry
      Orchestrator
      Session store
    Providers
      Claude Code
      Cursor Agent
      Codex
      Kimi and others
    Features
      Multi turn sessions
      Approval workflows
      Token budget limits
      Streaming events

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a Go application that can call any supported coding-agent CLI through one shared API

USE CASE 2

Stream text, tool calls, and turn events from an agent CLI subprocess

USE CASE 3

Manage multi-turn sessions with approval workflows and token budgets across different agent providers

What is it built with?

Go

How does it compare?

smallnest/agent-wrappershieldnet-360/prompt-gatetatanakots/fuckprivateclient
Stars282828
LanguageGoGoGo
Setup difficultymoderate
Complexity4/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

So what is it?

agent-wrapper is a Go library that provides a single unified programming interface for driving multiple AI coding agent command-line tools. The README is written in Chinese. The problem it addresses is that each coding agent CLI, such as Claude Code, Cursor Agent, Kimi Code, Codex, Pi Agent, and OpenCode, has its own protocol, authentication approach, and output format. This library wraps each one so that your own Go code only needs to interact with one consistent interface regardless of which agent is running underneath. The core abstraction is an Agent interface backed by a subprocess. When you run a prompt, the library launches the relevant CLI tool as a child process, reads its output stream, and delivers events through a Go channel. Events cover text output, tool calls, tool results, turn boundaries, and errors. There is also a synchronous API that collects all events and returns a single result object when the agent finishes. The orchestrator layer adds multi-turn conversation management, approval workflows (where your code can decide whether to allow a specific tool call), token budget limits, and context compression for long sessions. Sessions can be resumed across separate program runs using a session ID. The library covers eight providers at the time of the README: Claude Code, Cursor Agent, Kimi Code, Antigravity, Codex, Pi Agent, OpenCode, and an ACP-protocol provider. A command-line tool is also included for running any supported agent from a terminal with options for streaming output, JSON output, and session resumption. The README includes a section explaining why the library drives CLI subprocesses directly rather than using the ACP protocol standard, noting that the CLI tools expose more functionality than ACP server implementations typically surface. The project is MIT licensed.

Copy-paste prompts

Prompt 1
Show me how to use agent-wrapper's Go API to run a prompt against Claude Code
Prompt 2
Explain the difference between orch.Run and orch.RunSync in agent-wrapper
Prompt 3
How would I add a custom provider to agent-wrapper for a coding agent it doesn't support yet
Prompt 4
Why did agent-wrapper choose to wrap CLI subprocesses directly instead of using the ACP protocol

Frequently asked questions

What is agent-wrapper?

A Go library that gives you one consistent interface for driving Claude Code, Cursor, Codex, and other coding-agent CLIs from your own programs.

What language is agent-wrapper written in?

Mainly Go. The stack also includes Go.

Who is agent-wrapper for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.