claude-code-best/packages/acp-link
James Feng 2c5010129f fix(tsc): Phase 3d — fix 40 type errors across 15 files (87→47)
- contextCollapse stub: add 5 method stubs
- which.ts: utf-8 → utf8
- convertTools.test.ts, WebSearchTool, SkillTool, AttachmentMessage
- UserTextMessage dynamic require → React.createElement
- openai: AgentId cast, fetchOverride, streaming params
- constants: remove duplicate SYNTHETIC_OUTPUT_TOOL_NAME
2026-06-07 11:19:48 +08:00
..
src fix(tsc): Phase 3d — fix 40 type errors across 15 files (87→47) 2026-06-07 11:19:48 +08:00
.gitignore feat: pull in Vite build system + complete packages/builtin-tools/ 2026-06-01 18:18:03 +08:00
package.json feat: remote control 支持 auto bind 功能 (#300) 2026-06-04 23:53:13 +08:00
README.md feat: remote control 支持 auto bind 功能 (#300) 2026-06-04 23:53:13 +08:00
tsconfig.json feat: 支持 acp-link 包进行 acp 通用的 remote-control (#292) 2026-06-04 23:52:35 +08:00

acp-link

ACP proxy server that bridges WebSocket clients to ACP (Agent Client Protocol) agents.

Source code adapted from chrome-acp.

Installation

From source

# From monorepo root
bun install

Usage

# Via global install
acp-link /path/to/agent

# Via source
bun src/cli/bin.ts /path/to/agent

Examples

# Basic usage
acp-link /path/to/agent

# With custom port and host
acp-link --port 9000 --host 0.0.0.0 /path/to/agent

# With debug logging
acp-link --debug /path/to/agent

# Enable HTTPS with self-signed certificate
acp-link --https /path/to/agent

# Disable authentication (dangerous)
acp-link --no-auth /path/to/agent

# Register to RCS with a specific channel group
acp-link --group my-team /path/to/agent

# Pass arguments to the agent (use -- to separate)
acp-link /path/to/agent -- --verbose --model gpt-4

CLI Reference

USAGE
  acp-link [--port value] [--host value] [--debug] [--no-auth] [--https] [--group value] <command>...
  acp-link --help
  acp-link --version

FLAGS
       [--port]     Port to listen on                  [default = 9315]
       [--host]     Host to bind to                    [default = localhost]
       [--debug]    Enable debug logging to file
       [--no-auth]  Disable authentication (dangerous)
       [--https]    Enable HTTPS with self-signed cert
       [--group]    Channel group ID for RCS registration (letters, digits, hyphens, underscores only)
    -h  --help      Print help information and exit
    -v  --version   Print version information and exit

ARGUMENTS
  command...  Agent command followed by its arguments

How It Works

  1. Listens for WebSocket connections from clients
  2. When a "connect" message is received, spawns the configured ACP agent as a subprocess
  3. Bridges messages between the WebSocket (client) and stdin/stdout (agent via ACP protocol)
  4. Supports session management: create, load, resume, list sessions
  5. Handles permission approval flow and heartbeat keepalive

Authentication

By default, a random token is auto-generated on startup. Pass it as a query parameter:

ws://localhost:9315/ws?token=<your-token>

Set ACP_AUTH_TOKEN env var to use a fixed token, or use --no-auth to disable (not recommended).

RCS Upstream

acp-link can register to a Remote Control Server (RCS) for remote access. Set the following environment variables:

Variable Description
ACP_RCS_URL RCS server URL (e.g. http://rcs.example.com:3000)
ACP_RCS_TOKEN API token for RCS authentication
ACP_RCS_GROUP Channel group ID to lock the agent into (letters, digits, -, _ only)

You can also use --group <id> on the CLI. The CLI flag takes priority over the env var.

License

MIT