cg33andClaude 1beffe3f25 fix(telegram): UTF-8-safe command menu descriptions (fixes #119) (#301)
* fix(codex): avoid closing events channel before readLoop exits

Close() previously closed cs.events after an 8s wait even when wg.Wait
had not finished, while readLoop could still send in flushPendingAsText
(turn.completed), causing "panic: send on closed channel" after /stop
then /new. Defer channel close until readLoop completes.

Fixes https://github.com/chenhg5/cc-connect/issues/281

* fix(telegram): UTF-8-safe bot command descriptions and table rows (#119)

- Truncate BotCommand.Description by runes (Telegram 256-char limit); byte
  slicing broke CJK and caused API errors.
- Make truncateForLog rune-aware for debug prefixes.
- Parse markdown table rows without byte-slicing the outer pipes.

Fixes #119

Made-with: Cursor

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-24 14:16:04 +08:00
2026-03-23 21:55:00 +08:00

CC-Connect Banner

CI Status Release npm downloads License Go Report Card

Discord Telegram

English | 中文


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.

CC-Connect Architecture


🆕 What's New (beta)

These highlights are in beta / pre-release builds — install cc-connect@beta or grab a pre-release binary. They are not in the default stable release yet; details may change before promotion to stable.

  • Personal WeChat — Chat with your local agent from Weixin (personal) via ilink long-polling; QR weixin setup, CDN media, no public IP. Setup → docs/weixin.md
  • Auto-compress — When the session estimate blows past your threshold, cc-connect can trim context so long threads keep working instead of silently falling over.
  • Friendlier --continue — Fork-on-continue so your bridge session doesn’t inherit a half-finished CLI terminal session by accident.
  • Cron with boundaries — Run jobs in a fresh session each time and cap per-job timeouts so runaway tasks don’t wedge the bot.
  • Richer platforms — e.g. Discord @everyone / @here, Telegram voice-style replies, Feishu fixes for reply threading and async dispatch.

🧩 Platform feature snapshot

High-level view of what each built-in platform can do in cc-connect. Inspired by OpenClaw China’s feature matrix — handy for comparing channels at a glance.

Legend

Symbol Meaning
✅ Works in stable cc-connect with typical configuration
✅(beta) Beta / pre-release only — the Weixin (personal) column: install cc-connect@beta or a pre-release binary; not in the default stable npm build yet
⚠️ Partial, needs extra config (e.g. speech / ASR), or limited by the vendor app or API
❌ Not supported or not applicable in practice

† QQ (NapCat / OneBot) — unofficial self-hosted bridge; behaviour depends on your NapCat / network setup.

Capability Feishu DingTalk Telegram Slack Discord LINE WeCom Weixin
(personal)
QQ† QQ Bot
Text & slash commands ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅(beta) ✅ ✅
Markdown / cards ✅ ✅ ✅ ✅ ✅ ⚠️ ⚠️ ✅(beta) ✅ ✅
Streaming / chunked replies ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅(beta) ✅ ✅
Images & files ✅ ✅ ✅ ✅ ✅ ⚠️ ✅ ✅(beta) ✅ ✅
Voice / STT / TTS ⚠️ ⚠️ ✅ ⚠️ ⚠️ ❌ ⚠️ ✅(beta) ⚠️ ⚠️
Private (DM) ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅(beta) ✅ ✅
Group / channel ✅ ✅ ✅ ✅ ✅ ⚠️ ✅ ✅(beta) ✅ ✅

Weixin column: every ✅(beta) means “available only when you run a beta / pre-release build,” not a statement that the feature is incomplete — the whole personal WeChat (ilink) channel is still pre-stable.
WeCom: Webhook mode needs a public URL; long-connection / WS style setups often do not.
Voice row: many platforms need [speech] / TTS providers enabled in config.toml; values are a best-effort summary.
Per-platform setup: Platform setup guides below.


✨ 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

10 Chat Platforms — Feishu, DingTalk, Slack, Telegram, Discord, WeChat Work, LINE, QQ, QQ Bot (Official), plus Weixin (personal ilink) for personal WeChat. Personal WeChat is beta / pre-release only — install cc-connect@beta or a GitHub pre-release binary; the default stable npm package does not ship the weixin platform yet. Most platforms 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.

Directory Switching in Chat — Change where the next session starts with /dir <path> (and /cd <path> as a compatibility alias), plus quick history jump via /dir <number> / /dir -.

🧠 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.


飞书 Telegram 微信

Left:Lark  |  Telegram  |  Right:Wechat


🚀 Quick Start

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

Personal WeChat (Weixin ilink): only available in beta / pre-release builds (cc-connect@beta or a prerelease asset under Releases). Stable npm install -g cc-connect does not include this platform until it graduates from 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

Set admin_from = "alice,bob" in a project to allow those user IDs to run privileged commands such as /dir and /shell. When a user runs /dir reset, cc-connect restores the configured work_dir and clears the persisted override stored under data_dir/projects/<project>.state.json.


▶️ 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 Weixin (personal, ilink) ✅(beta)— HTTP long polling — no public IP needed
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)
Weixin (personal) docs/weixin.md HTTP long polling (ilink) — beta only No
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
/dir [path|reset] Show, switch, or reset work directory

🔐 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

🤖 Model Selection

/model                      List available models (format: alias - model)
/model switch <alias>       Switch to model by alias

📂 Work Directory

/dir                         Show current work directory and history
/dir <path>                  Switch to a path (relative or absolute)
/dir <number>                Switch from history
/dir -                       Switch to previous directory
/cd <path>                   Compatibility alias for /dir <path>

⏰ Scheduled Tasks

/cron add 0 6 * * * Summarize GitHub trending

📎 Agent Attachment Send-Back

When an agent generates a local screenshot, chart, PDF, bundle, or other file, it can send that attachment back to the current chat.

First release supports:

  • Feishu
  • Telegram

If your agent does not natively inject the system prompt, run this once in chat after upgrading:

/bind setup

or:

/cron setup

This refreshes the cc-connect instructions in the project memory file so the agent knows how to send attachments back.

You can control this feature globally in config.toml:

attachment_send = "on"  # default: "on"; set to "off" to block image/file send-back

This switch is independent from the agent's /mode. It only controls cc-connect send --image/--file.

Examples:

cc-connect send --image /absolute/path/to/chart.png
cc-connect send --file /absolute/path/to/report.pdf
cc-connect send --file /absolute/path/to/report.pdf --image /absolute/path/to/chart.png

Notes:

  • Absolute paths are the safest option.
  • --image and --file can both be repeated.
  • attachment_send = "off" disables only attachment send-back; ordinary text replies still work.
  • This command is for generated attachments, not ordinary text replies.

📖 Full documentation: docs/usage.md


📚 Documentation


👥 Community


🙏 Contributors


⭐ Star History

Star History Chart

📄 License

MIT License


Built with ❤️ by the cc-connect community

S
Description
Bridge local AI coding agents (Claude Code, Cursor, Gemini CLI, Codex) to messaging platforms (Feishu/Lark, DingTalk, Slack, Telegram, Discord, LINE, WeChat Work). Chat with your AI dev assistant from anywhere — no public IP required for most platforms.
Readme
24 MiB
0 Stars 1 Watchers 0 Forks
Languages
Go 91.9%
TypeScript 7.5%
JavaScript 0.2%
Makefile 0.1%
HTML 0.1%
Other 0.1%