drainEvents uses a select loop with a default case to drain buffered events. When the channel is closed, receives always succeed immediately with a zero value, so the default case never triggers and the function spins in an infinite loop, consuming 100% CPU. Check the ok value from the receive and return immediately when the channel is closed. Add regression tests for both closed and open channel scenarios.
Control your local AI agents from any chat app. Anywhere, anytime.
cc-connect bridges AI agents running on your machine to the messaging platforms you already use.
Code review, research, automation, data analysis — anything an AI agent can do,
now accessible from your phone, tablet, or any device with a chat app.
✨ Why cc-connect?
🤖 Universal Agent Support
7 AI Agents — Claude Code, Codex, Cursor Agent, Qoder CLI, Gemini CLI, OpenCode, iFlow CLI. Use whichever fits your workflow, or all of them at once.
📱 Platform Flexibility
9 Chat Platforms — Feishu, DingTalk, Slack, Telegram, Discord, WeChat Work, LINE, QQ, QQ Bot (Official). Most need zero public IP.
🔄 Multi-Agent Orchestration
Multi-Bot Relay — Bind multiple bots in a group chat and let them communicate with each other. Ask Claude, get insights from Gemini — all in one conversation.
🎮 Complete Chat Control
Full Control from Chat — Switch models (/model), tune reasoning (/reasoning), change permission modes (/mode), manage sessions, all via slash commands.
🧠 Persistent Memory
Agent Memory — Read and write agent instruction files (/memory) without touching the terminal.
⏰ Intelligent Scheduling
Scheduled Tasks — Set up cron jobs in natural language. "Every day at 6am, summarize GitHub trending" just works.
🎤 Multimodal Support
Voice & Images — Send voice messages or screenshots; cc-connect handles STT/TTS and multimodal forwarding.
📦 Multi-Project Architecture
Multi-Project — One process, multiple projects, each with its own agent + platform combo.
🌍 Multilingual Interface
5 Languages — Native support for English, Chinese (Simplified & Traditional), Japanese, and Spanish. Built-in i18n ensures everyone feels at home.
Left:Lark | Telegram | Right:Wechat
🚀 Quick Start
🤖 Install & Configure via AI Agent (Recommended)
The easiest way — Send this to Claude Code or any AI coding agent, and it will handle the entire installation and configuration for you:
Follow https://raw.githubusercontent.com/chenhg5/cc-connect/refs/heads/main/INSTALL.md to install and configure cc-connect.
📦 Manual Install
Via npm:
# Stable version
npm install -g cc-connect
# Beta version (more features, may be unstable)
npm install -g cc-connect@beta
Download binary from GitHub Releases:
# Linux amd64 - Stable
curl -L -o cc-connect https://github.com/chenhg5/cc-connect/releases/latest/download/cc-connect-linux-amd64
chmod +x cc-connect
sudo mv cc-connect /usr/local/bin/
# Beta version (from pre-release)
curl -L -o cc-connect https://github.com/chenhg5/cc-connect/releases/download/v1.x.x-beta/cc-connect-linux-amd64
Build from source (requires Go 1.22+):
git clone https://github.com/chenhg5/cc-connect.git
cd cc-connect
make build
⚙️ Configure
mkdir -p ~/.cc-connect
cp config.example.toml ~/.cc-connect/config.toml
vim ~/.cc-connect/config.toml
▶️ Run
./cc-connect
🔄 Upgrade
# npm
npm install -g cc-connect
# Binary self-update
cc-connect update # Stable
cc-connect update --pre # Beta (includes pre-releases)
📊 Support Matrix
| Component | Type | Status |
|---|---|---|
| Agent | Claude Code | ✅ Supported |
| Agent | Codex (OpenAI) | ✅ Supported |
| Agent | Cursor Agent | ✅ Supported |
| Agent | Gemini CLI (Google) | ✅ Supported |
| Agent | Qoder CLI | ✅ Supported |
| Agent | OpenCode (Crush) | ✅ Supported |
| Agent | iFlow CLI | ✅ Supported |
| Agent | Goose (Block) | 🔜 Planned |
| Agent | Aider | 🔜 Planned |
| Platform | Feishu (Lark) | ✅ WebSocket — no public IP needed |
| Platform | DingTalk | ✅ Stream — no public IP needed |
| Platform | Telegram | ✅ Long Polling — no public IP needed |
| Platform | Slack | ✅ Socket Mode — no public IP needed |
| Platform | Discord | ✅ Gateway — no public IP needed |
| Platform | LINE | ✅ Webhook — public URL required |
| Platform | WeChat Work | ✅ WebSocket / Webhook |
| Platform | QQ (NapCat/OneBot) | ✅ WebSocket — Beta |
| Platform | QQ Bot (Official) | ✅ WebSocket — no public IP needed |
📖 Platform Setup Guides
| Platform | Guide | Connection | Public IP? |
|---|---|---|---|
| Feishu (Lark) | docs/feishu.md | WebSocket | No |
| DingTalk | docs/dingtalk.md | Stream | No |
| Telegram | docs/telegram.md | Long Polling | No |
| Slack | docs/slack.md | Socket Mode | No |
| Discord | docs/discord.md | Gateway | No |
| WeChat Work | docs/wecom.md | WebSocket / Webhook | No (WS) / Yes (Webhook) |
| QQ / QQ Bot | docs/qq.md | WebSocket | No |
🎯 Key Features
💬 Session Management
/new [name] Start a new session
/list List all sessions
/switch <id> Switch session
/current Show current session
🔐 Permission Modes
/mode Show available modes
/mode yolo # Auto-approve all tools
/mode default # Ask for each tool
🔄 Provider Management
/provider list List providers
/provider switch <name> Switch API provider at runtime
⏰ Scheduled Tasks
/cron add 0 6 * * * Summarize GitHub trending
📖 Full documentation: docs/usage.md
📚 Documentation
- Usage Guide — Complete feature documentation
- INSTALL.md — AI-agent-friendly installation guide
- config.example.toml — Configuration template
👥 Community
🙏 Contributors
⭐ Star History
📄 License
MIT License
Built with ❤️ by the cc-connect community
