mirror of
https://github.com/chenhg5/cc-connect.git
synced 2026-10-26 01:50:40 +08:00
3b097a80cb2694e56714f1dd8aabaef9d8240bc7
cc-connect
English | 中文
Bridge your local AI coding assistants (Claude Code / Cursor / Gemini CLI / Codex) to messaging platforms like Feishu (Lark), DingTalk, Slack, and more. Chat with your local AI agent from anywhere — no public IP required.
Architecture
┌──────────────┐ ┌────────────┐ ┌──────────────┐
│ Feishu/Ding │◄───►│ Engine │◄───►│ Claude Code │
│ Slack/... │ │ (Router) │ │ Cursor/... │
└──────────────┘ └────────────┘ └──────────────┘
Platform Core Agent
- Platform — Messaging platform adapter. Handles receiving/sending messages over WebSocket, Stream, etc.
- Agent — AI assistant adapter. Invokes the local AI tool and collects its response.
- Engine — Core router. Forwards platform messages to the agent and relays responses back.
All components are decoupled via Go interfaces — fully pluggable and extensible.
Support Matrix
| Component | Type | Status |
|---|---|---|
| Agent | Claude Code | ✅ Supported |
| Agent | Cursor Agent | 🔜 Planned |
| Agent | Gemini CLI | 🔜 Planned |
| Agent | Codex | 🔜 Planned |
| Platform | Feishu (Lark) | ✅ Supported |
| Platform | DingTalk | ✅ Supported |
| Platform | Slack | 🔜 Planned |
| Platform | Telegram | 🔜 Planned |
Quick Start
Prerequisites
- Go 1.22+
- Claude Code CLI installed and configured
Install
git clone https://github.com/chenhg5/cc-connect.git
cd cc-connect
make build
Configure
cp config.example.toml config.toml
vim config.toml
Run
# Use default config file (config.toml)
./cc-connect
# Use a custom config file
./cc-connect -config /path/to/config.toml
Configuration
[agent]
type = "claudecode"
[agent.options]
work_dir = "/path/to/your/project"
[[platforms]]
type = "feishu"
[platforms.options]
app_id = "cli_xxxx"
app_secret = "xxxx"
Feishu (Lark)
- Create an app at Feishu Open Platform
- Enable the Bot capability
- Add the
im.message.receive_v1event under Event Subscriptions - Select WebSocket long connection mode (no public IP needed)
- Copy the App ID and App Secret into your config
DingTalk
- Create an app at DingTalk Open Platform
- Create a Bot and select Stream mode
- Copy the Client ID and Client Secret into your config
Extending
Adding a New Platform
Implement the core.Platform interface and register it:
package myplatform
import "github.com/chenhg5/cc-connect/core"
func init() {
core.RegisterPlatform("myplatform", New)
}
func New(opts map[string]any) (core.Platform, error) {
return &MyPlatform{}, nil
}
// Implement Name(), Start(), Reply(), Stop()
Then add a blank import in cmd/cc-connect/main.go:
_ "github.com/chenhg5/cc-connect/platform/myplatform"
Adding a New Agent
Same pattern — implement core.Agent and register via core.RegisterAgent.
Project Structure
cc-connect/
├── cmd/cc-connect/ # Entrypoint
│ └── main.go
├── core/ # Core abstractions
│ ├── interfaces.go # Platform + Agent interfaces
│ ├── registry.go # Plugin-style factory registry
│ ├── message.go # Unified message types
│ ├── session.go # Session management
│ └── engine.go # Message routing engine
├── platform/ # Platform adapters
│ ├── feishu/ # Feishu / Lark (WebSocket)
│ └── dingtalk/ # DingTalk (Stream)
├── agent/ # Agent adapters
│ └── claudecode/ # Claude Code CLI
├── config/ # Config loading
├── config.example.toml # Config template
├── Makefile
└── README.md
License
MIT
Languages
Go
95.3%
TypeScript
4.4%
JavaScript
0.1%