DeGraciaMathieu

Acp PHP — Development skill for Claude Code

Development community

PHP SDK for the Agent Client Protocol (ACP): drive coding agents like Claude Code, Codex or Gemini CLI from PHP.

How to install Acp PHP

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

What Acp PHP does

PHP SDK for the Agent Client Protocol (ACP): drive coding agents like Claude Code, Codex or Gemini CLI from PHP.

Alternatives in Development

  • Vibe Kanban — Get 10X more out of Claude Code, Gemini CLI, Codex, Amp and other coding agents 23.5k ★
  • Agent Of Empires — Manage multiple Claude Code, OpenCode agents from either TUI or Web for easy access on mobile 3.1k ★
  • Vibekit — A simple SDK for safely running Codex, Gemini CLI, and Claude Code in a secure sandbox 1.7k ★

README

acp-php

A PHP SDK for the [Agent Client Protocol](https://agentclientprotocol.com) (ACP), the open protocol between clients (editors, orchestrators, CI) and coding agents such as Claude Code, Codex or Gemini CLI.

**Status: early work in progress (0.1.0-dev).** The client side works end to end: it drives `claude-agent-acp` 0.112.0 through initialize, session creation and streamed updates. The API may still change.

Why

ACP has official SDKs in Rust, TypeScript, Python, Kotlin and Java, and community ones in many languages, but none in PHP. This package aims to let a PHP application drive agents the same way an editor does: open sessions, send prompts, stream updates, answer permission and elicitation requests.

Driving an agent

use Acp\AgentProcess;
use Acp\Client\FileSystem\LocalFileSystem;
use Acp\Client\Permission\ApproveAll;
use Acp\Schema\SessionUpdate;

$agent = AgentProcess::start(
    'claude-agent-acp',                        // npm i -g @agentclientprotocol/claude-agent-acp
    cwd: '/home/me/game',
    env: ['ANTHROPIC_API_KEY' => null],        // use the Claude Code login, not API billing
);

$client = $agent->connect(
    permissions: new ApproveAll(),             // default: reject everything
    fileSystem: new LocalFileSystem('/home/me/game'), // optional: serve file reads and writes, confined to a root
);
$client->initialize();

$session = $client->newSession(cwd: '/home/me/game');
$turn = $session->prompt('Switch the game to a dark theme');

foreach ($turn->updates() as $update) {
    if ($update instanceof SessionUpdate\ToolCall) {
        echo "→ {$update->title}\n";
    }
}

$turn->stopReason();             // StopReason::EndTurn
echo $turn->text();              // the agent's answer, as plain text

$agent->stop();

The API reads synchronously, but runs on [amphp](https://amphp.org) fibers: while your code waits on a turn, the SDK keeps reading the agent's messages and answering its requests.

Turns

  • `$session->prom