cc-connect Manager
Manage cc-connect projects by editing ~/.cc-connect/config.toml and restarting the service in tmux.
Config file
Path: INLINECODE1
Add a project
Extract these from the user's request:
- - name: project name (derive from workdir basename if not given, e.g.
/path/to/my-app → my-app) - workdir: absolute path to the project directory
- platform: one of
telegram, discord, feishu, dingtalk, slack, line, wecom, qq, INLINECODE12 - token: the bot token (varies by platform)
- agent: default
claudecode, or codex, cursor, gemini, qoder, opencode, INLINECODE19 - mode: default
default. For claudecode: acceptEdits/plan/bypassPermissions. For codex: suggest/auto-edit/full-auto/ INLINECODE27
Run the add script:
CODEBLOCK0
Platform-specific token mapping:
- - telegram:
--token = bot token from @BotFather - discord:
--token = bot token, optionally --guild-id for instant slash commands - feishu:
--app-id + INLINECODE32 - dingtalk:
--app-id + INLINECODE34 - slack:
--bot-token (xoxb-) + --app-token (xapp-)
After adding, read back ~/.cc-connect/config.toml and show the user the new project block for confirmation.
Multi-agent relay setup (bind)
To put multiple agents (e.g. Claude Code + Codex) in the same chat group:
Architecture
- - Each agent needs its own bot (separate token) as a separate
[[projects]] entry - All bots join the same group/channel/server
- After startup, use
/bind in the chat to link them for relay communication
Step-by-step
- 1. Add project A (e.g.
claude-backend, agent=claudecode, platform=discord, token=bot-A-token) - Add project B (e.g.
codex-backend, agent=codex, platform=discord, token=bot-B-token) - Both bots must use the same platform type and join the same group/channel
- Restart cc-connect
- Tell the user to send these commands in the chat group (not here):
@bot-A /bind claude-backend
@bot-A /bind codex-backend
Or for any bot that supports slash commands:
/bind <project-name>
- 6. After binding, agents can relay messages to each other. @bot-A sends to Claude Code, @bot-B sends to Codex
Important notes
- -
/bind is a runtime chat command, not a config file setting — it cannot be automated from here - Binding persists in INLINECODE44
- Each bot in the group needs a unique token (you cannot reuse the same bot for two projects)
Remove a project
Read ~/.cc-connect/config.toml, find the [[projects]] block with matching name, remove it and all its sub-sections ([projects.agent], [projects.agent.options], [[projects.platforms]], [projects.platforms.options]) up to the next [[projects]] or global section. Write the file back.
Restart cc-connect
cc-connect runs in a tmux session named cc-connect. To restart:
CODEBLOCK2
If the tmux session doesn't exist yet:
CODEBLOCK3
Always restart after adding or removing a project.
Workflow
- 1. Parse the user's natural language request to extract project params
- Run
add_project.py for each project (or manually edit for removal) - Show the user the updated config block
- Restart cc-connect in tmux
- Confirm success by checking tmux output: INLINECODE54
- If multi-agent setup, remind the user to run
/bind <project-name> for each project in the chat group
cc-connect 管理器
通过编辑 ~/.cc-connect/config.toml 并在 tmux 中重启服务来管理 cc-connect 项目。
配置文件
路径:~/.cc-connect/config.toml
添加项目
从用户的请求中提取以下信息:
- - name:项目名称(如果未提供,则从工作目录的基目录名派生,例如 /path/to/my-app → my-app)
- work_dir:项目目录的绝对路径
- platform:平台类型,可选 telegram、discord、feishu、dingtalk、slack、line、wecom、qq、qqbot
- token:机器人令牌(因平台而异)
- agent:默认为 claudecode,可选 codex、cursor、gemini、qoder、opencode、iflow
- mode:默认为 default。对于 claudecode:acceptEdits/plan/bypassPermissions。对于 codex:suggest/auto-edit/full-auto/yolo
运行添加脚本:
bash
python3 ~/.claude/skills/cc-connect-manager/scripts/add_project.py \
--name --work-dir --platform --token \
[--agent ] [--mode ] [--guild-id ]
各平台令牌映射:
- - telegram:--token = 来自 @BotFather 的机器人令牌
- discord:--token = 机器人令牌,可选 --guild-id 用于即时斜杠命令
- feishu:--app-id + --app-secret
- dingtalk:--app-id + --app-secret
- slack:--bot-token(xoxb-)+ --app-token(xapp-)
添加完成后,重新读取 ~/.cc-connect/config.toml 并向用户展示新的项目块以供确认。
多智能体中继设置(绑定)
要将多个智能体(例如 Claude Code + Codex)放入同一个聊天群组:
架构
- - 每个智能体需要自己的机器人(独立的令牌)作为单独的 [[projects]] 条目
- 所有机器人加入同一个群组/频道/服务器
- 启动后,在聊天中使用 /bind 将它们链接起来进行中继通信
分步操作
- 1. 添加项目 A(例如 claude-backend,agent=claudecode,platform=discord,token=bot-A-token)
- 添加项目 B(例如 codex-backend,agent=codex,platform=discord,token=bot-B-token)
- 两个机器人必须使用相同的平台类型并加入相同的群组/频道
- 重启 cc-connect
- 告诉用户在聊天群组中(不是在这里)发送以下命令:
@bot-A /bind claude-backend
@bot-A /bind codex-backend
或者对于支持斜杠命令的机器人:/bind
- 6. 绑定后,智能体可以相互中继消息。@bot-A 发送给 Claude Code,@bot-B 发送给 Codex
重要说明
- - /bind 是一个运行时聊天命令,不是配置文件设置——无法从这里自动执行
- 绑定信息持久化存储在 ~/.cc-connect/relay_bindings.json 中
- 群组中的每个机器人需要唯一的令牌(不能为两个项目重复使用同一个机器人)
移除项目
读取 ~/.cc-connect/config.toml,找到名称匹配的 [[projects]] 块,删除它及其所有子部分([projects.agent]、[projects.agent.options]、[[projects.platforms]]、[projects.platforms.options]),直到下一个 [[projects]] 或全局部分。写回文件。
重启 cc-connect
cc-connect 在名为 cc-connect 的 tmux 会话中运行。重启方式:
bash
终止 tmux 中现有的 cc-connect 进程并重新启动
tmux send-keys -t cc-connect C-c && sleep 1 && tmux send-keys -t cc-connect cc-connect Enter
如果 tmux 会话尚不存在:
bash
tmux new-session -d -s cc-connect cc-connect
添加或移除项目后务必重启。
工作流程
- 1. 解析用户的自然语言请求,提取项目参数
- 为每个项目运行 add_project.py(或手动编辑以移除项目)
- 向用户展示更新后的配置块
- 在 tmux 中重启 cc-connect
- 通过检查 tmux 输出来确认成功:tmux capture-pane -t cc-connect -p | tail -5
- 如果是多智能体设置,提醒用户在聊天群组中为每个项目运行 /bind