cc-channel
v0.1.1
Published
Feishu/Lark channel for Claude Code - trigger Claude Code from Feishu messages
Maintainers
Readme
cc-channel
Feishu/Lark channel for Claude Code - trigger Claude Code from Feishu messages
A lightweight service that lets you use Claude Code from Feishu/Lark. Send messages to your Feishu bot and get responses from Claude Code running on your local machine.
Features
- 🚀 Easy setup - One command initialization
- 💬 Multi-turn conversations - Maintains context across messages
- 🔄 Background service - Runs as a daemon, no terminal needed
- 📁 Per-chat working directory - Each chat can have its own working directory
- 🌐 WebSocket connection - No public IP or port forwarding required
Prerequisites
- Node.js 18+
- Claude Code CLI installed and configured
- A Feishu/Lark self-built application (see setup guide below)
Installation
npm install -g cc-channelQuick Start
1. Create a Feishu Application
- Go to Feishu Open Platform (or Lark Developer for international)
- Create a new "Self-built Application" (自建应用)
- Note down your App ID and App Secret
- In the app settings:
- Enable "Bot" capability (机器人能力)
- Add message event subscription:
im.message.receive_v1 - Configure event subscription method as WebSocket (事件订阅方式: 使用长连接接收事件)
2. Initialize cc-channel
cc-channel initThis will guide you through:
- Entering your Feishu App ID and Secret
- Setting the default working directory
- Testing the connection
- Starting the background service
3. Use in Feishu
- Add your bot to a group chat, or
- Start a direct message with the bot
Send any message to trigger Claude Code!
Usage
Commands
# Initialize configuration
cc-channel init
# Start background service
cc-channel start
# Start in foreground (for debugging)
cc-channel start --foreground
# Stop background service
cc-channel stop
# Show status
cc-channel status
# View logs
cc-channel logs
cc-channel logs --follow
# Configuration
cc-channel config list
cc-channel config set claude.defaultWorkDir ~/projectsIn-Chat Commands
When messaging the bot in Feishu:
| Command | Description |
|---------|-------------|
| (any message) | Execute with Claude Code |
| /cc help | Show available commands |
| /cc cd <path> | Change working directory |
| /cc pwd | Show current directory |
| /cc clear | Clear conversation history |
| /cc status | Show session status |
Configuration
Configuration is stored in ~/.cc-channel/config.json.
Example Configuration
{
"feishu": {
"appId": "cli_xxxx",
"appSecret": "xxxx",
"verificationToken": "",
"encryptKey": "",
"domain": "feishu"
},
"claude": {
"defaultWorkDir": "~",
"timeout": 300000
}
}Environment Variables
You can also configure via environment variables:
CC_CHANNEL_FEISHU_APP_IDCC_CHANNEL_FEISHU_APP_SECRETCC_CHANNEL_FEISHU_DOMAINCC_CHANNEL_WORK_DIR
How It Works
┌─────────────────┐ WebSocket ┌─────────────────┐
│ Feishu Bot │ ◄───────────────► │ cc-channel │
│ (Cloud) │ │ (Local) │
└─────────────────┘ └────────┬────────┘
│
│ spawn
▼
┌─────────────────┐
│ Claude Code │
│ CLI │
└─────────────────┘- You send a message to your Feishu bot
- Feishu pushes the event via WebSocket to cc-channel
- cc-channel spawns Claude Code CLI with your message
- The response is sent back to Feishu
Multi-turn Conversations
cc-channel maintains conversation history per chat:
- Each chat (direct message or group) has its own session
- Context is passed to Claude Code for follow-up questions
- Use
/cc clearto start a fresh conversation
Security Considerations
- Only users who can message your Feishu bot can trigger Claude Code
- All execution happens locally on your machine
- Session data is stored in
~/.cc-channel/sessions/
Troubleshooting
Claude CLI not found
# Check if claude is in PATH
which claude
# If installed but not found, add to PATH
export PATH="$PATH:$(dirname $(which claude))"Connection issues
- Verify your App ID and Secret are correct
- Make sure WebSocket mode is enabled in Feishu app settings
- Check logs:
cc-channel logs
Service not starting
# Check service status
cc-channel status
# Try running in foreground to see errors
cc-channel start --foregroundDevelopment
# Clone the repo
git clone https://github.com/L-x-C/cc-channel.git
cd cc-channel
# Install dependencies
npm install
# Build
npm run build
# Run locally
node dist/cli.js initLicense
MIT
