synapse-a2a
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSynapse A2A Communication
Synapse A2A 通信
Inter-agent communication framework via Google A2A Protocol.
基于Google A2A协议的Agent间通信框架。
Quick Reference
快速参考
| Task | Command |
|---|---|
| List agents (Rich TUI) | |
| Send message | |
| Broadcast to cwd agents | |
| Wait for reply | |
| Reply to last message | |
| Reply to specific sender | |
| List reply targets | |
| Emergency stop | |
| Stop agent | |
| Kill agent (graceful) | |
| Kill agent (force) | |
| Jump to terminal | |
| Rename agent | |
| Check file locks | |
| View history | |
| Initialize settings | |
| Edit settings (TUI) | |
| View settings | |
| Reset settings | |
| Show instructions | |
| Send instructions | |
| View logs | |
| Add external agent | |
| List external agents | |
| External agent info | |
| Send to external | |
| Remove external agent | |
| Skill Manager (TUI) | |
| List skills | |
| Show skill detail | |
| Deploy skill | |
| Import skill | |
| Install from repo | |
| Create skill | |
| List skill sets | |
| Auth setup | |
| Generate API key | |
| List task board | |
| Create task | |
| Assign task | |
| Complete task | |
| Approve plan | |
| Reject plan | |
| Start team (CLI) | |
| Start team (API) | |
| Delegate mode | |
| Version info | |
Tip: Run before sending to verify the target agent is READY.
synapse list| 任务 | 命令 |
|---|---|
| 列出Agent(富文本终端界面) | |
| 发送消息 | |
| 向当前工作目录下的Agent广播消息 | |
| 等待回复 | |
| 回复最后一条消息 | |
| 回复特定发送方 | |
| 列出回复目标 | |
| 紧急停止 | |
| 停止Agent | |
| 优雅终止Agent | |
| 强制终止Agent | |
| 跳转到Agent终端 | |
| 重命名Agent | |
| 检查文件锁 | |
| 查看历史记录 | |
| 初始化设置 | |
| 编辑设置(终端界面) | |
| 查看设置 | |
| 重置设置 | |
| 显示指令 | |
| 发送指令 | |
| 查看日志 | |
| 添加外部Agent | |
| 列出外部Agent | |
| 查看外部Agent信息 | |
| 向外部Agent发送消息 | |
| 删除外部Agent | |
| Skill管理器(终端界面) | |
| 列出Skill | |
| 查看Skill详情 | |
| 部署Skill | |
| 导入Skill | |
| 从仓库安装Skill | |
| 创建Skill | |
| 列出Skill集合 | |
| 认证设置 | |
| 生成API密钥 | |
| 列出任务看板 | |
| 创建任务 | |
| 分配任务 | |
| 完成任务 | |
| 批准计划 | |
| 拒绝计划 | |
| 启动Agent团队(命令行) | |
| 启动Agent团队(API) | |
| 委托模式 | |
| 版本信息 | |
提示: 发送消息前先运行,确认目标Agent处于READY状态。
synapse listSending Messages (Recommended)
发送消息(推荐方式)
Use command for inter-agent communication. This works reliably from any environment including sandboxed agents.
synapse sendbash
synapse send gemini "Please review this code" --response --from synapse-claude-8100
synapse send claude "What is the status?" --response --from synapse-codex-8121
synapse send codex-8120 "Fix this bug" --response --priority 3 --from synapse-gemini-8110Important:
- Always use with your agent ID (format:
--from). Do NOT use custom names or agent types forsynapse-<type>-<port>.--from - By default, use to wait for a reply. Only use
--responsefor notifications or fire-and-forget tasks.--no-response
Target Resolution (Matching Priority):
- Custom name: (highest priority, exact match, case-sensitive)
my-claude - Exact ID: (direct match)
synapse-claude-8100 - Type-port: ,
claude-8100,codex-8120,opencode-8130(shorthand)copilot-8140 - Type only: ,
claude,gemini,codex,opencode(only if single instance)copilot
Note: When multiple agents of the same type are running, type-only targets (e.g., ) will fail with an ambiguity error. Use custom name (e.g., ) or type-port shorthand (e.g., ) instead.
claudemy-claudeclaude-8100使用命令进行Agent间通信。 该命令在包括沙箱Agent在内的任何环境中都能可靠工作。
synapse sendbash
synapse send gemini "请审核这段代码" --response --from synapse-claude-8100
synapse send claude "当前状态如何?" --response --from synapse-codex-8121
synapse send codex-8120 "修复这个bug" --response --priority 3 --from synapse-gemini-8110重要提示:
- 务必使用参数指定你的Agent ID(格式:
--from)。不要使用自定义名称或Agent类型作为synapse-<type>-<port>的值。--from - 默认使用参数等待回复。仅在发送通知或无需回复的任务时使用
--response。--no-response
目标解析优先级:
- 自定义名称:(最高优先级,精确匹配,区分大小写)
my-claude - 精确ID:(直接匹配)
synapse-claude-8100 - 类型-端口简写:、
claude-8100、codex-8120、opencode-8130(简写形式)copilot-8140 - 仅类型:、
claude、gemini、codex、opencode(仅当该类型只有一个实例时可用)copilot
注意: 当同一类型存在多个Agent时,仅使用类型作为目标(例如)会因歧义而失败。请改用自定义名称(例如)或类型-端口简写(例如)。
claudemy-claudeclaude-8100Choosing --response vs --no-response
选择--response还是--no-response
Analyze the message content and determine if a reply is expected:
- If the message expects or benefits from a reply → use
--response - If the message is purely informational with no reply needed → use
--no-response - If unsure, use (safer default)
--response
bash
undefined分析消息内容,判断是否需要回复:
- 如果消息需要或期望回复 → 使用
--response - 如果消息仅为通知类,无需回复 → 使用
--no-response - 若不确定,默认使用(更安全的选择)
--response
bash
undefinedMessage that expects a reply
需要回复的消息
synapse send gemini "What is the best approach?" --response --from synapse-claude-8100
synapse send gemini "最佳方案是什么?" --response --from synapse-claude-8100
Purely informational, no reply needed
纯通知类消息,无需回复
synapse send codex "FYI: Build completed" --no-response --from synapse-claude-8100
undefinedsynapse send codex "通知:构建已完成" --no-response --from synapse-claude-8100
undefinedRoundtrip Communication (--response)
往返通信(--response)
For request-response patterns:
bash
undefined适用于请求-响应模式:
bash
undefinedSender: Wait for response (blocks until reply received)
发送方:等待回复(阻塞直到收到回复)
synapse send gemini "Analyze this data" --response --from synapse-claude-8100
synapse send gemini "分析这些数据" --response --from synapse-claude-8100
Receiver: Reply to sender (auto-routes via reply tracking)
接收方:回复发送方(通过回复跟踪自动路由)
synapse reply "Analysis result: ..."
The `--response` flag makes the sender wait. The receiver should reply using the `synapse reply` command.
**Reply Tracking:** Synapse automatically tracks senders who expect a reply (`[REPLY EXPECTED]` messages). Use `synapse reply` for responses - it automatically knows who to reply to.synapse reply "分析结果:..."
`--response`参数会让发送方处于等待状态。接收方应使用`synapse reply`命令进行回复。
**回复跟踪:** Synapse会自动跟踪期望回复的发送方(标记为`[REPLY EXPECTED]`的消息)。使用`synapse reply`进行回复时,系统会自动知道回复目标。Broadcasting to All Agents
向所有Agent广播消息
Send a message to all agents sharing the same working directory:
bash
undefined向与发送方处于同一工作目录的所有Agent发送消息:
bash
undefinedBroadcast status check to all cwd agents
向当前工作目录下的所有Agent发送状态检查广播
synapse broadcast "Status check" --from synapse-claude-8100
synapse broadcast "状态检查" --from synapse-claude-8100
Urgent broadcast
紧急广播
synapse broadcast "Urgent: stop all work" --priority 4 --from synapse-claude-8100
synapse broadcast "紧急:停止所有工作" --priority 4 --from synapse-claude-8100
Fire-and-forget broadcast
无需回复的广播
synapse broadcast "FYI: Build completed" --no-response --from synapse-claude-8100
**Note:** Broadcast only targets agents in the **same working directory** as the sender. This prevents unintended messages to agents working on different projects.synapse broadcast "通知:构建已完成" --no-response --from synapse-claude-8100
**注意:** 广播仅针对与发送方处于**同一工作目录**的Agent。这可避免向处理不同项目的Agent发送意外消息。Receiving and Replying to Messages
接收并回复消息
When you receive an A2A message, it appears with the prefix:
A2A:Message Formats:
A2A: [REPLY EXPECTED] <message> <- Reply is REQUIRED
A2A: <message> <- Reply is optional (one-way notification)If marker is present, you MUST reply using .
[REPLY EXPECTED]synapse replyReply Tracking: Synapse stores sender info only for messages with marker. Multiple senders can be tracked simultaneously (each sender has one entry).
[REPLY EXPECTED]Replying to messages:
bash
undefined当你收到A2A消息时,消息会以前缀显示:
A2A:消息格式:
A2A: [REPLY EXPECTED] <消息内容> <- 必须回复
A2A: <消息内容> <- 回复可选(单向通知)如果消息带有标记,你必须使用进行回复。
[REPLY EXPECTED]synapse reply回复跟踪: Synapse仅为带有标记的消息存储发送方信息。可同时跟踪多个发送方(每个发送方对应一条记录)。
[REPLY EXPECTED]回复消息的方式:
bash
undefinedUse the reply command (auto-routes to last sender)
使用回复命令(自动路由到最后一个发送方)
synapse reply "Here is my analysis..."
synapse reply "这是我的分析结果..."
When multiple senders are pending, inspect and choose target
当有多个待回复发送方时,先查看并选择目标
synapse reply --list-targets
synapse reply "Here is my analysis..." --to <sender_id>
synapse reply --list-targets
synapse reply "这是我的分析结果..." --to <sender_id>
In sandboxed environments (like Codex), specify your agent ID
在沙箱环境中(如Codex),需指定你的Agent ID
synapse reply "Here is my analysis..." --from <your_agent_id>
**Example - Question received (MUST reply):**Received: A2A: [REPLY EXPECTED] What is the project structure?
Reply: synapse reply "The project has src/, tests/..."
**Example - Delegation received (no reply needed):**Received: A2A: Run the tests and fix failures
Action: Just do the task. No reply needed unless you have questions.
undefinedsynapse reply "这是我的分析结果..." --from <your_agent_id>
**示例 - 收到需要回复的问题:**收到:A2A: [REPLY EXPECTED] 项目结构是什么?
回复: synapse reply "项目包含src/、tests/..."
**示例 - 收到委托任务(无需回复):**收到:A2A: 运行测试并修复失败项
操作: 直接执行任务即可。除非有疑问,否则无需回复。
undefinedPriority Levels
优先级级别
| Priority | Description | Use Case |
|---|---|---|
| 1-2 | Low | Background tasks |
| 3 | Normal | Standard tasks |
| 4 | Urgent | Follow-ups, status checks |
| 5 | Interrupt | Emergency (sends SIGINT first) |
Default priority: = 3 (normal), = 1 (low).
sendbroadcastbash
undefined| 优先级 | 描述 | 使用场景 |
|---|---|---|
| 1-2 | 低 | 后台任务 |
| 3 | 正常 | 标准任务 |
| 4 | 紧急 | 跟进任务、状态检查 |
| 5 | 中断 | 紧急情况(先发送SIGINT信号) |
默认优先级:命令为3(正常),命令为1(低)。
sendbroadcastbash
undefinedNormal priority (default: 3) - with response
正常优先级(默认:3)- 等待回复
synapse send gemini "Analyze this" --response --from synapse-claude-8100
synapse send gemini "分析这个内容" --response --from synapse-claude-8100
Higher priority - urgent request
高优先级 - 紧急请求
synapse send claude "Urgent review needed" --response --priority 4 --from synapse-codex-8121
synapse send claude "急需审核" --response --priority 4 --from synapse-codex-8121
Emergency interrupt
紧急中断
synapse send codex "STOP" --priority 5 --from synapse-claude-8100
undefinedsynapse send codex "STOP" --priority 5 --from synapse-claude-8100
undefinedAgent Status
Agent状态
| Status | Meaning | Color |
|---|---|---|
| READY | Idle, waiting for input | Green |
| WAITING | Awaiting user input (selection, confirmation) | Cyan |
| PROCESSING | Busy handling a task | Yellow |
| DONE | Task completed (auto-clears after 10s) | Blue |
| SHUTTING_DOWN | Graceful shutdown in progress | Red |
Verify before sending: Run and confirm the target agent's Status column shows :
synapse listREADYbash
synapse list| 状态 | 含义 | 颜色 |
|---|---|---|
| READY | 空闲,等待输入 | 绿色 |
| WAITING | 等待用户输入(选择、确认) | 青色 |
| PROCESSING | 正忙于处理任务 | 黄色 |
| DONE | 任务已完成(10秒后自动清除) | 蓝色 |
| SHUTTING_DOWN | 正在进行优雅关闭 | 红色 |
发送前验证: 运行,确认目标Agent的状态列显示为:
synapse listREADYbash
synapse listOutput (NAME column shows custom name if set, otherwise agent ID):
输出(NAME列显示自定义名称,若无则显示Agent ID):
NAME TYPE STATUS PORT WORKING_DIR
NAME TYPE STATUS PORT WORKING_DIR
my-claude claude READY 8100 my-project # <- has custom name
my-claude claude READY 8100 my-project # <- 已设置自定义名称
gemini gemini WAITING 8110 my-project # <- no custom name, shows type
gemini gemini WAITING 8110 my-project # <- 无自定义名称,显示类型
codex codex PROCESSING 8120 my-project # <- busy
codex codex PROCESSING 8120 my-project # <- 忙碌中
**Status meanings:**
- `READY`: Safe to send messages
- `WAITING`: Agent needs user input - use terminal jump (see below) to respond
- `PROCESSING`: Busy, wait or use `--priority 5` for emergency interrupt
- `DONE`: Recently completed, will return to READY shortly
**状态含义:**
- `READY`:可安全发送消息
- `WAITING`:Agent需要用户输入 - 使用终端跳转(见下文)进行响应
- `PROCESSING`:忙碌中,可等待或使用`--priority 5`进行紧急中断
- `DONE`:最近完成任务,很快会返回READY状态Interactive Controls
交互控制
In , you can interact with agents:
synapse list| Key | Action |
|---|---|
| Select agent row (direct) |
| Navigate agent rows |
| Jump to selected agent's terminal |
| Kill selected agent (with confirmation) |
| Filter by TYPE, NAME, or WORKING_DIR |
| Clear filter first, then selection |
| Quit |
Supported Terminals:
- iTerm2 (macOS) - Switches to correct tab/pane
- Terminal.app (macOS) - Switches to correct tab
- Ghostty (macOS) - Activates application
- VS Code integrated terminal - Opens to working directory
- tmux - Switches to agent's session
- Zellij - Focuses agent's terminal pane
Use case: When an agent shows status, use terminal jump to quickly respond to its selection prompt.
WAITING在界面中,你可以与Agent进行交互:
synapse list| 按键 | 操作 |
|---|---|
| 直接选择Agent行 |
| 导航Agent行 |
| 跳转到选中Agent的终端 |
| 终止选中Agent(需确认) |
| 按类型、名称或工作目录过滤 |
| 先清除过滤器,再清除选择 |
| 退出 |
支持的终端:
- iTerm2(macOS)- 切换到正确的标签/面板
- Terminal.app(macOS)- 切换到正确的标签
- Ghostty(macOS)- 激活应用程序
- VS Code集成终端 - 打开到工作目录
- tmux - 切换到Agent的会话
- Zellij - 聚焦Agent的终端面板
使用场景: 当Agent显示状态时,使用终端跳转快速响应其选择提示。
WAITINGAgent Naming
Agent命名
Assign custom names and roles to agents for easier identification:
bash
undefined为Agent分配自定义名称和角色,便于识别:
bash
undefinedStart with name and role
启动时指定名称和角色
synapse claude --name my-claude --role "code reviewer"
synapse claude --name my-claude --role "代码审核员"
Skip interactive name/role setup
跳过交互式名称/角色设置
synapse claude --no-setup
synapse claude --no-setup
Update name/role after agent is running
Agent运行后更新名称/角色
synapse rename synapse-claude-8100 --name my-claude --role "test writer"
synapse rename my-claude --role "documentation" # Change role only
synapse rename my-claude --clear # Clear name and role
Once named, use the custom name for all operations:
```bash
synapse send my-claude "Review this code" --from synapse-codex-8121
synapse jump my-claude
synapse kill my-claudeName vs ID:
- Display/Prompts: Shows name if set, otherwise ID (e.g., )
Kill my-claude (PID: 1234)? - Internal processing: Always uses agent ID ()
synapse-claude-8100 - Target resolution: Name has highest priority when matching targets
synapse rename synapse-claude-8100 --name my-claude --role "测试编写者"
synapse rename my-claude --role "文档编写" # 仅修改角色
synapse rename my-claude --clear # 清除名称和角色
设置名称后,所有操作均可使用自定义名称:
```bash
synapse send my-claude "审核这段代码" --from synapse-codex-8121
synapse jump my-claude
synapse kill my-claude名称与ID的区别:
- 显示/提示: 若设置了名称则显示名称,否则显示ID(例如:)
Kill my-claude (PID: 1234)? - 内部处理: 始终使用Agent ID()
synapse-claude-8100 - 目标解析: 名称在匹配目标时优先级最高
External Agent Management
外部Agent管理
Connect to external A2A-compatible agents over HTTP/HTTPS:
bash
undefined通过HTTP/HTTPS连接到兼容A2A协议的外部Agent:
bash
undefinedDiscover and add an external agent
发现并添加外部Agent
synapse external add https://agent.example.com --alias myagent
synapse external add https://agent.example.com --alias myagent
List registered external agents
列出已注册的外部Agent
synapse external list
synapse external list
Show agent details (capabilities, skills)
查看Agent详情(功能、Skill)
synapse external info myagent
synapse external info myagent
Send message to external agent
向外部Agent发送消息
synapse external send myagent "Analyze this data"
synapse external send myagent "Process file" --wait # Wait for completion
synapse external send myagent "分析这些数据"
synapse external send myagent "处理文件" --wait # 等待完成
Remove agent
删除Agent
synapse external remove myagent
External agents are stored persistently in `~/.a2a/external/`.synapse external remove myagent
外部Agent的信息会持久存储在`~/.a2a/external/`目录中。Authentication
认证
Secure A2A communication with API key authentication:
bash
undefined使用API密钥认证保障A2A通信安全:
bash
undefinedInteractive setup (generates keys + shows instructions)
交互式设置(生成密钥并显示操作说明)
synapse auth setup
synapse auth setup
Generate API key(s)
生成API密钥
synapse auth generate-key
synapse auth generate-key -n 3 -e # 3 keys in export format
synapse auth generate-key
synapse auth generate-key -n 3 -e # 生成3个可导出格式的密钥
Enable authentication
启用认证
export SYNAPSE_AUTH_ENABLED=true
export SYNAPSE_API_KEYS=<key>
export SYNAPSE_ADMIN_KEY=<admin_key>
synapse claude
undefinedexport SYNAPSE_AUTH_ENABLED=true
export SYNAPSE_API_KEYS=<key>
export SYNAPSE_ADMIN_KEY=<admin_key>
synapse claude
undefinedResume Mode
恢复模式
Start agents without sending initial instructions (for session recovery):
bash
synapse claude -- --resume
synapse gemini -- --resume
synapse codex -- resume # Codex: resume is a subcommand
synapse opencode -- --continue
synapse copilot -- --continueTo inject instructions later: .
synapse instructions send <agent>启动Agent时不发送初始指令(用于会话恢复):
bash
synapse claude -- --resume
synapse gemini -- --resume
synapse codex -- resume # Codex:resume是子命令
synapse opencode -- --continue
synapse copilot -- --continue后续可通过以下命令注入指令:。
synapse instructions send <agent>Key Features
核心功能
- Agent Naming: Custom names and roles for easy identification
- Agent Communication: command,
synapse sendfor cwd-scoped messaging, priority control, response handlingsynapse broadcast - Task History: Search, export, statistics ()
synapse history - File Safety: Lock files to prevent conflicts (); active locks shown in
synapse file-safetyEDITING_FILE columnsynapse list - External Agents: Connect to external A2A agents ()
synapse external - Authentication: API key-based security ()
synapse auth - Skill Management: Central skill store, deploy, import, create, skill sets ()
synapse skills - Settings: Configure via (
settings.json)synapse init - Approval Mode: Control initial instruction approval (in settings)
approvalMode - Shared Task Board: Create, claim, and complete tasks with dependency tracking ()
synapse tasks - Quality Gates: Configurable hooks (,
on_idle) that gate status transitionson_task_completed - Plan Approval: Plan-mode workflow with for review
synapse approve/reject - Graceful Shutdown: sends shutdown request before SIGTERM (30s timeout)
synapse kill - Delegate Mode: creates a coordinator that delegates instead of editing files
--delegate-mode - Auto-Spawn Panes: launches multiple agents in split panes
synapse team start
- Agent命名: 自定义名称和角色,便于识别
- Agent通信: 命令、
synapse send用于当前工作域消息发送、优先级控制、回复处理synapse broadcast - 任务历史: 搜索、导出、统计()
synapse history - 文件安全: 锁定文件以避免冲突();
synapse file-safety的EDITING_FILE列会显示活跃的文件锁synapse list - 外部Agent: 连接到外部A2A Agent()
synapse external - 认证: 基于API密钥的安全机制()
synapse auth - Skill管理: 集中式Skill仓库、部署、导入、创建、Skill集合()
synapse skills - 设置: 通过配置(
settings.json)synapse init - 审批模式: 控制初始指令的审批(设置中的)
approvalMode - 共享任务看板: 创建、认领、完成任务,支持依赖跟踪()
synapse tasks - 质量门: 可配置的钩子(、
on_idle),用于控制状态转换on_task_completed - 计划审批: 计划模式工作流,使用进行审核
synapse approve/reject - 优雅关闭: 先发送关闭请求,30秒超时后发送SIGTERM信号
synapse kill - 委托模式: 创建一个协调器,负责委托任务而非直接编辑文件
--delegate-mode - 自动生成面板: 在拆分面板中启动多个Agent
synapse team start
Path Overrides
路径覆盖
When running multiple environments or tests, override storage paths via env vars:
- (default:
SYNAPSE_REGISTRY_DIR)~/.a2a/registry - (default:
SYNAPSE_EXTERNAL_REGISTRY_DIR)~/.a2a/external - (default:
SYNAPSE_HISTORY_DB_PATH)~/.synapse/history/history.db - (default:
SYNAPSE_SKILLS_DIR)~/.synapse/skills
运行多环境或测试时,可通过环境变量覆盖存储路径:
- (默认:
SYNAPSE_REGISTRY_DIR)~/.a2a/registry - (默认:
SYNAPSE_EXTERNAL_REGISTRY_DIR)~/.a2a/external - (默认:
SYNAPSE_HISTORY_DB_PATH)~/.synapse/history/history.db - (默认:
SYNAPSE_SKILLS_DIR)~/.synapse/skills
References
参考文档
For detailed documentation, read:
- - Full CLI command reference
references/commands.md - - File Safety detailed guide
references/file-safety.md - - A2A endpoints and message format
references/api.md - - Multi-agent workflow examples
references/examples.md
如需详细文档,请阅读:
- - 完整CLI命令参考
references/commands.md - - 文件安全详细指南
references/file-safety.md - - A2A端点及消息格式
references/api.md - - 多Agent工作流示例
references/examples.md