Files
cc-connect/config.example.toml
T
2026-03-01 00:09:50 +08:00

175 lines
6.1 KiB
TOML

# cc-connect configuration
# Copy this file to config.toml and fill in your credentials.
#
# Each [[projects]] entry binds one code directory to its own agent + platforms.
# A single cc-connect process can manage multiple projects simultaneously.
# =============================================================================
# Global Settings
# =============================================================================
# Language for bot messages
# - "en": English
# - "zh": Chinese
# - "" (empty/not set): Auto-detect from user's first message
# language = "en"
[log]
level = "info" # debug, info, warn, error
# =============================================================================
# Project 1
# =============================================================================
[[projects]]
name = "my-backend"
[projects.agent]
type = "claudecode"
[projects.agent.options]
work_dir = "/path/to/backend"
mode = "default" # "default" | "acceptEdits" (edit) | "plan" | "bypassPermissions" (yolo)
# Mode options:
# - "interactive": Claude will ask for permission before sensitive operations.
# When using IM platforms (Feishu, DingTalk, etc.), you can reply "允许" or "allow"
# to grant permission. Progress updates will be sent in real-time.
# - "auto": All operations are automatically approved (use with caution).
# Best for trusted environments or when you want uninterrupted execution.
# In default/acceptEdits mode, you can pre-approve specific tools:
# allowed_tools = ["Read", "Grep", "Glob", "Bash", "Edit", "Write"]
# Optional: specify a model
# model = "claude-sonnet-4-20250514"
# Feishu / Lark
# 1. Create an app at https://open.feishu.cn
# 2. Enable Bot capability
# 3. Add im.message.receive_v1 event, select WebSocket long-connection mode
# 4. Fill in app_id and app_secret below
# Note: No WebSocket URL needed — the SDK auto-negotiates the connection via credentials.
[[projects.platforms]]
type = "feishu"
[projects.platforms.options]
app_id = "your-feishu-app-id"
app_secret = "your-feishu-app-secret"
# DingTalk (uncomment to enable)
# 1. Create an app at https://open-dev.dingtalk.com
# 2. Under "App Features > Bot", enable the bot capability and select Stream mode
# 3. Fill in client_id (AppKey) and client_secret (AppSecret) below
# Note: No WebSocket URL needed — the DingTalk Stream SDK handles the connection.
# [[projects.platforms]]
# type = "dingtalk"
#
# [projects.platforms.options]
# client_id = "your-dingtalk-client-id"
# client_secret = "your-dingtalk-client-secret"
# Telegram (uncomment to enable)
# 1. Message @BotFather on Telegram, send /newbot to create a bot
# 2. Copy the bot token below
# Connection: Long polling (no public URL needed)
# [[projects.platforms]]
# type = "telegram"
#
# [projects.platforms.options]
# token = "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
# Slack (uncomment to enable)
# 1. Create an app at https://api.slack.com/apps
# 2. Enable Socket Mode (Settings > Socket Mode)
# 3. Subscribe to bot events: message.channels, message.im (Event Subscriptions)
# 4. Install app to workspace, copy Bot Token (xoxb-...) and App Token (xapp-...)
# Connection: Socket Mode WebSocket (no public URL needed)
# [[projects.platforms]]
# type = "slack"
#
# [projects.platforms.options]
# bot_token = "xoxb-your-bot-token"
# app_token = "xapp-your-app-level-token"
# Discord (uncomment to enable)
# 1. Create an app at https://discord.com/developers/applications
# 2. Under "Bot", create a bot and copy the token
# 3. Enable "Message Content Intent" under Privileged Gateway Intents
# 4. Invite bot to server with OAuth2 URL Generator (scopes: bot; permissions: Send Messages)
# Connection: Gateway WebSocket (no public URL needed)
# [[projects.platforms]]
# type = "discord"
#
# [projects.platforms.options]
# token = "your-discord-bot-token"
# LINE (uncomment to enable)
# 1. Create a channel at https://developers.line.biz/console/ (Messaging API)
# 2. Copy Channel Secret and Channel Access Token (long-lived)
# 3. Set your webhook URL to: http(s)://<your-domain>:<port>/callback
# Connection: HTTP Webhook — you need a public URL (use ngrok, cloudflared, etc.)
# The built-in HTTP server listens on the configured port; expose it yourself.
# [[projects.platforms]]
# type = "line"
#
# [projects.platforms.options]
# channel_secret = "your-line-channel-secret"
# channel_token = "your-line-channel-access-token"
# port = "8080"
# callback_path = "/callback"
# WeChat Work / 企业微信 (uncomment to enable)
# 1. Log in to https://work.weixin.qq.com/wework_admin/frame
# 2. App Management > Create a custom app > note AgentId + Secret
# 3. My Enterprise > note Corp ID
# 4. App > Receive Messages > Set API Receive:
# URL: http(s)://<your-domain>:<port>/wecom/callback
# Token: any random string
# EncodingAESKey: click "Random Generate" (43 chars)
# (Start cc-connect FIRST, then save to pass verification)
# 5. App > Trusted IP > add your server's outbound IP
# 6. (Optional) My Enterprise > WeChat Plugin > scan QR to link personal WeChat
# Connection: HTTP Webhook — you need a public URL (use ngrok, cloudflared, etc.)
# [[projects.platforms]]
# type = "wecom"
#
# [projects.platforms.options]
# corp_id = "your-corp-id"
# corp_secret = "your-app-secret"
# agent_id = "1000002"
# callback_token = "your-callback-token"
# callback_aes_key = "your-43-char-encoding-aes-key"
# port = "8081"
# callback_path = "/wecom/callback"
# enable_markdown = false # set true to send Markdown messages (only renders in WeChat Work app, NOT personal WeChat)
# proxy = "" # optional: forward proxy for API calls if your IP is dynamic
# e.g. "http://your-vps-ip:8888" — the VPS IP goes into trusted IP list
# =============================================================================
# Project 2 (uncomment to enable)
# =============================================================================
# [[projects]]
# name = "my-frontend"
#
# [projects.agent]
# type = "claudecode"
#
# [projects.agent.options]
# work_dir = "/path/to/frontend"
# mode = "bypassPermissions"
#
# [[projects.platforms]]
# type = "telegram"
#
# [projects.platforms.options]
# token = "your-telegram-bot-token"