Connect GitHub Copilot CLI to mobile messaging platforms for remote interaction from phone.
Phone IM App → IM Platform API → Bridge Tool → Copilot CLI (ACP protocol) → Response → IM App
Two bridge tools:
| Feature | Feishu (cc-connect) | WeChat (wechat-acp) | DingTalk (cc-connect) |
|---|---|---|---|
| --------- | ------------------- | -------------------- | -------------------- |
| Text messages | ✅ | ✅ | ✅ |
| Send files to chat | ✅ via cc-connect send | ❌ | ✅ via cc-connect send |
| Send images | ✅ --image | ❌ | ✅ --image |
| Session context | ✅ per-user | ✅ | ✅ per-user |
| Official bot API | ✅ 企业自建应用 | ❌ 需hook | ✅ |
| Setup difficulty | Medium | High | Medium |
brew install copilot-cli or npm i -g @github/copilot)copilot login, or COPILOT_GITHUB_TOKEN env var)brew install cc-connect or download from GitHub releases)# macOS (Homebrew)
brew install cc-connect
# Linux / Windows: download from https://github.com/nicepkg/cc-connect/releases
See references/feishu-setup.md for detailed step-by-step with screenshots guidance.
Quick summary:
im:message 系列 (接收/发送消息, 约 20 个子权限全选即可)im:resource (可选, 仅文件/图片发送需要)接收消息 (im.message.receive_v1) + 用户进入与机器人的会话App ID 和 App SecretCopilot CLI requires a valid GitHub authentication. You can choose any of the following public methods:
Option A: Interactive login (recommended for first setup)
copilot login
# Opens browser for OAuth device flow. Token stored in system keychain.
Option B: Environment variable (recommended for headless/service use)
# Checked in order: COPILOT_GITHUB_TOKEN > GH_TOKEN > GITHUB_TOKEN
# Supported: fine-grained PAT with "Copilot Requests" permission, or OAuth tokens
export COPILOT_GITHUB_TOKEN="<your_github_token>"
Option C: Reuse GitHub CLI token (portable, if token has required permission)
gh auth login
export COPILOT_GITHUB_TOKEN="$(gh auth token)"
Option D: Read token from secret manager/CI env (recommended for teams)
# Example pattern (replace with your secret manager command)
export COPILOT_GITHUB_TOKEN="$(<your_secret_manager_command>)"
Option E: Wrapper script (for services that need dynamic tokens)
#!/bin/bash
# ~/.cc-connect/run-copilot.sh
export COPILOT_GITHUB_TOKEN="<your_github_token_or_command_output>"
exec /opt/homebrew/bin/copilot "$@"
Quick compatibility notes:
copilot login is simplest for personal machinesgh auth token is convenient but depends on token permission in your org/accountCOPILOT_GITHUB_TOKEN via secret manager is best for shared servers and CI> ⚠️ CRITICAL: Do NOT use the VS Code shim at ~/Library/Application Support/Code/User/globalStorage/github.copilot-chat/copilotCli/copilot — it only works within VS Code's terminal context. Always use the real binary (e.g., /opt/homebrew/bin/copilot).
Create ~/.cc-connect/config.toml:
language = "zh"
[log]
level = "info" # use "debug" for troubleshooting
[[projects]]
name = "copilot-feishu"
filter_external_sessions = true
# admin_from = "<your_open_id>" # Send /whoami to bot to discover; enables admin commands
[projects.agent]
type = "acp"
[projects.agent.options]
work_dir = "/path/to/ascii-only-workspace" # CRITICAL: no Chinese characters!
command = "/opt/homebrew/bin/copilot" # or wrapper script path
args = ["--acp", "--stdio", "--yolo"]
display_name = "GitHub Copilot CLI"
[[projects.platforms]]
type = "feishu"
[projects.platforms.options]
app_id = "<feishu_app_id>"
app_secret = "<feishu_app_secret>"
enable_feishu_card = false # plain text mode is more stable
progress_style = "compact"
allow_from = "*" # or "<your_open_id>" for whitelist
macOS with wrapper script example:
[projects.agent.options]
work_dir = "$HOME/.cc-connect/feishu-workspace"
command = "$HOME/.cc-connect/run-copilot.sh"
args = ["--acp", "--stdio", "--yolo"]
cc-connect --config ~/.cc-connect/config.toml
Expected startup logs:
INFO config loaded
INFO feishu: bot identified open_id=ou_xxxxx
INFO platform ready
INFO engine started
INFO cc-connect is running
[Info] [connected to wss://msg-frontier.feishu.cn/ws/v2?...]
Send a message to the bot in Feishu. Look for:
INFO message received
INFO processing message
INFO session spawned ← Authentication OK!
INFO turn complete ← Response sent
See references/persistence.md for:
See references/wechat-setup.md for the complete WeChat bridge guide.
When Copilot runs in ACP mode behind cc-connect, each incoming IM message may start an isolated Copilot session. To preserve continuity, use a history-sync pattern:
message.sent event, run a hook script to rebuild .github/copilot-instructions.mdThis gives practical, near-continuous memory in Feishu chat without modifying cc-connect or Copilot source code.
See references/context-persistence.md for:
hooks, auto_compress, dedicated work_dir)cc-connect supports sending files/images to chat via its CLI send subcommand. To make Copilot auto-send files, add to .github/copilot-instructions.md in your work_dir:
## File Sending Rules
When you create files for the user or when asked to send files:
- Send files: `cc-connect send --file "<absolute_path>" -p <project_name>`
- Send images: `cc-connect send --image "<absolute_path>" -p <project_name>`
- Always use absolute paths
--yolo recommended — Prevents Copilot from blocking on confirmations when you're awaywork_dir for IM bridge vs local CLI to avoid session conflicts; or set filter_external_sessions = trueSee references/troubleshooting.md for:
subst drive mapping共 1 个版本