Skip to content

feiyun0112/AgentBridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

中文

AgentBridge

Multi AI Agent Bridge — chat to AI agents (Claude, Codex, Gemini, Kimi, Cursor, Copilot and more).

Quick Start

# Start (runs as background daemon; auto-login if no account saved)
agent-bridge start --provider weixin

On first start, AgentBridge will:

  1. Display a QR code — scan with WeChat to log in
  2. Auto-detect installed AI agents (Claude, Codex, Gemini, etc.)
  3. Save configuration to ~/.agent-bridge/config.json
  4. Begin receiving and replying to WeChat messages

Use agent-bridge login --provider weixin to add additional WeChat accounts.

Architecture

Projects:

Project Description
AgentBridge.CLI CLI entry point (agent-bridge executable) — commands, daemon management
AgentBridge.Core Core agent abstraction — ACP/CLI agent drivers, config, markdown conversion
AgentBridge.Weixin WeChat provider — ILink long-poll client, message handling, CDN upload, HTTP API

Agent integration modes:

Mode How it works Supported agents
ACP Long-lived subprocess communicating via stdio JSON-RPC 2.0. Fastest — reuses process and session. Claude, Codex, Kimi, Gemini, Cursor, OpenCode, OpenClaw
CLI Spawns a new process per message. Supports --resume for session continuity. Claude (claude -p), Codex (codex exec), Copilot

When both ACP and CLI variants are installed, ACP is automatically preferred.

CLI Commands

agent-bridge <command> --provider <provider> [options]
Command Description
login Add a WeChat account via QR code scan
start Start the agent bridge (background daemon by default)
stop Stop the background daemon
restart Restart the background daemon
status Check if the daemon is running

start options

Option Description
--provider <provider> Provider name (required), current only support weixin
--foreground / -f Run in foreground instead of as a daemon
--api-addr <addr> HTTP API listen address (default 127.0.0.1:18088)
--dangerously-skip-permissions Skip all agent permission prompts (YOLO mode)

Chat Commands

Send these commands in a chat:

Command Description
Hello Send to the default agent
/copilot write a sort function Send to a specific agent
/claude Switch the default agent to Claude
/status Show current agent info
/help Show help message

Configuration

Config file: ~/.agent-bridge/config.json

{
  "default_agent": "claude",
  "agents": {
    "claude": {
      "type": "acp",
      "command": "/usr/local/bin/claude-agent-acp",
      "model": "sonnet"
    },
    "codex": {
      "type": "cli",
      "command": "/usr/local/bin/copilot"
    }
  }
}

The config is created automatically on first run. Agents are auto-detected from PATH.

Agent config fields

Field Description
type acp or cli
command Path or name of the agent binary
args Extra CLI arguments
cwd Working directory for the agent process (defaults to ~/.agent-bridge/workspace)
model Model name passed to the agent
system_prompt Custom system prompt

Environment variables

Variable Description
AGENT_BRIDGE_DEFAULT_AGENT Override the default agent
AGENT_BRIDGE_API_ADDR Override the HTTP API listen address

Auto-detected Agents

AgentBridge scans PATH on startup and configures any of the following it finds:

Agent Binary (ACP preferred) Command
Claude claude-agent-acp / claude /claude
Codex codex-acp / codex /codex
Cursor agent acp /cursor
Kimi kimi acp /kimi
Gemini gemini --acp /gemini
OpenCode opencode acp /opencode
OpenClaw openclaw acp /openclaw
Copilot copilot (CLI) /copilot

Logs & Data

Path Description
~/.agent-bridge/config.json Main configuration
~/.agent-bridge/<provider>/agent-bridge.log Daemon log
~/.agent-bridge/<provider>/agent-bridge.pid Daemon PID file
~/.agent-bridge/weixin/accounts/ WeChat credentials
~/.agent-bridge/workspace/ Default agent working directory

Building from Source

Prerequisites: .NET 8 SDK

# Restore & build
dotnet build AgentBridge.slnx

# Run directly
dotnet run --project src/AgentBridge.CLI --framework net8.0 -- start --provider weixin

# Publish self-contained binary (Windows example)
dotnet publish src/AgentBridge.CLI -c Release -r win-x64 --self-contained

About

Multi AI Agent Bridge — chat to AI agents (Claude, Codex, Gemini, Kimi, Cursor, Copilot and more).

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages