Feishu (Lark) Setup
Connect your CCCC working group to Feishu for enterprise collaboration in China.
Overview
Feishu (飞书, also known as Lark internationally) is ideal for:
- Chinese enterprises
- Teams already using Feishu
- Bytedance ecosystem users
Prerequisites
- Feishu enterprise account with admin access
- CCCC installed and running
Step 1: Create an App
- Go to Feishu Open Platform
- Click Create Custom App
- Fill in the app information:
- App Name (e.g., "CCCC Bot")
- App Description
- App Icon
- Click Create
Step 2: Configure Permissions
- Go to Permissions & Scopes
- Click Add permission scopes to app
- Search for
im:messagein the search box - Select the Tenant token scopes tab
- Click All to select all
im:messagerelated scopes - Click Confirm and Apply

Quick Setup
Selecting all im:message scopes ensures the bot has full messaging capabilities including sending, receiving, and managing messages.
Step 3: Configure CCCC
- In your app dashboard, go to Credentials & Basic Info
- Copy App ID and App Secret
Security
Keep your App Secret confidential. Never commit it to version control.
Option A: Via Web UI
- Open the CCCC Web UI at
http://127.0.0.1:8848/ - Go to Settings (gear icon in header)
- Navigate to the IM Bridge tab
- Select Feishu/Lark as the platform
- Enter your credentials:
- App ID: Your Feishu App ID (e.g.,
cli_a9e92055a5b89bc6) - App Secret: Your Feishu App Secret
- App ID: Your Feishu App ID (e.g.,
- Click Save Config

Option B: Via CLI
First set environment variables:
export FEISHU_APP_ID="cli_your_app_id"
export FEISHU_APP_SECRET="your_app_secret"Then configure CCCC:
cccc im set feishu \
--app-key-env FEISHU_APP_ID \
--app-secret-env FEISHU_APP_SECRETBoth methods save to group.yaml:
im:
platform: feishu
feishu_app_id_env: FEISHU_APP_ID
feishu_app_secret_env: FEISHU_APP_SECRETStep 4: Start the Bridge
Via Web UI
Click the Save Config button in the IM Bridge settings. The bridge will start automatically and show Running status.
Via CLI
cccc im startVerify it's running:
cccc im statusStep 5: Enable Persistent Connection (Recommended)
Prerequisite
The CCCC IM Bridge must be running before you can configure event subscriptions. Enable persistent connection so CCCC can receive events via a long connection (no public callback URL required for this mode).
- Go back to Feishu Open Platform
- Navigate to your app → Events & Callbacks
- In Event Configuration tab, find Subscription mode
- Select Receive events through persistent connection (Recommended)
- Click Save

Step 6: Configure Event Subscriptions
- In Event Subscriptions, click Add Events
- Subscribe to the following events:
| Event | Purpose |
|---|---|
im.message.receive_v1 | Receive messages |
im.message.message_read_v1 | Read receipts |
- Click Save
Step 7: Enable Bot
Why This Step?
You must enable the Bot capability so users can find and chat with your bot after the app is published.
- In the sidebar, go to Features → Bot
- In Bot Setting, fill in the Get started field with a greeting message (e.g., "cccc im")
- Click Save

Step 8: Publish the App
- Go to Version Management & Release
- Create a new version
- Submit for review (enterprise apps may auto-approve)
- Once approved, publish to your organization
Step 9: Subscribe in Feishu
- Find the bot in your Feishu app
- Start a chat or add to a group
- Send
/subscribe - Confirm the subscription
Usage
Sending Messages to Agents
In group chats, @mention the bot first, then use the /send command:
@YourBotName /send Please implement the login featureIn direct messages with the bot, you can use /send directly:
/send Please implement the login featureDefault Recipient
When using /send without specifying a recipient (like @foreman or @all), messages are automatically sent to the foreman (team lead agent). This simplifies common interactions.
Important
- In group chats, you must @mention the bot before using commands
- Plain messages without the
/sendcommand are ignored
Targeting Specific Agents
Use @mention syntax with the /send command:
/send @backend Check the API endpoints
/send @all Status update please
/send @peers Please review the PRReceiving Messages
After subscribing, you will automatically receive:
- Agent responses
- Status updates
- Error notifications
Use /verbose to toggle whether you see agent-to-agent messages.
File Sharing
Attach files to your message. Feishu files are downloaded and stored in CCCC's blob storage, then forwarded to agents.
Commands Reference
| Command | Description |
|---|---|
/subscribe | Start receiving messages from CCCC |
/unsubscribe | Stop receiving messages |
/send <message> | Send to foreman (default) |
/send @<actor> <message> | Send to a specific agent |
/send @all <message> | Send to all agents |
/send @peers <message> | Send to non-foreman agents |
/status | Show group and agent status |
/pause | Pause message delivery |
/resume | Resume message delivery |
/verbose | Toggle verbose mode (see all agent messages) |
/help | Show available commands |
Troubleshooting
"Invalid app_id" Error
- Verify your App ID in the Feishu Open Platform
- Check environment variable is set correctly
- Ensure the app is published and approved
"Permission denied" Error
- Go to Permissions & Scopes
- Add the missing permission
- Submit a new version for approval
Bot not receiving messages
- Check Event Subscriptions are configured
- Verify the app is installed in the chat
- Ensure the app version is published
- Make sure CCCC IM Bridge is running
Token expired
CCCC auto-refreshes tokens, but if issues persist:
cccc im stop
cccc im startAdvanced Configuration
CCCC currently supports:
- Outbound messages via REST APIs
- Inbound messages via persistent connection (Python
lark-oapi)
Webhook callbacks (developer server URL), message cards, and encryption settings are not configured through CCCC at the moment.
Security Notes
- Store credentials in environment variables or a secrets manager
- Use the minimal required permissions
- Review app access regularly
- Enable platform encryption for sensitive communications (optional)
- Audit app usage through Feishu admin console