GPT Proto
Home/Skills/claude-to-im

claude-to-im

Bridge THIS Claude Code or Codex session to Telegram, Discord, Feishu/Lark, QQ, or WeChat so the

Download for Windows

config.env.example

# Claude-to-IM Bridge Configuration
# Copy to ~/.claude-to-im/config.env and edit

# Runtime backend: claude | codex | auto
#   claude (default) — uses Claude Code CLI + @anthropic-ai/claude-agent-sdk
#   codex  — uses @openai/codex-sdk (auth: codex auth login, or OPENAI_API_KEY)
#   auto   — tries Claude first, falls back to Codex if CLI not found
CTI_RUNTIME=claude

# Enabled channels (comma-separated: telegram,discord,feishu,qq,weixin)
CTI_ENABLED_CHANNELS=telegram

# Default working directory for Claude Code sessions
CTI_DEFAULT_WORKDIR=/path/to/your/project

# Default model (optional — inherits from runtime's own default if not set)
# CTI_DEFAULT_MODEL=

# Default mode (code, plan, ask)
CTI_DEFAULT_MODE=code

# ── Claude CLI path (optional) ──
# Override if you have multiple `claude` versions in PATH, or the daemon
# picks the wrong one (e.g. an npm-installed 1.x instead of the native 2.x).
# CTI_CLAUDE_CODE_EXECUTABLE=/path/to/claude

# ── Third-party API provider (optional) ──
# If you use Claude through a third-party API provider (not the default
# Anthropic API), set these so the daemon forwards them to the CLI subprocess.
# They are automatically passed through in both inherit and strict env modes.
# All ANTHROPIC_* vars in this file are forwarded to the launchd/setsid daemon.
# ANTHROPIC_API_KEY=your-third-party-api-key
# ANTHROPIC_BASE_URL=https://your-api-provider.com/v1
# ANTHROPIC_AUTH_TOKEN=your-auth-token

# ── Codex auth (optional — only if not using `codex auth login`) ──
# Priority: CTI_CODEX_API_KEY > CODEX_API_KEY > OPENAI_API_KEY
# CTI_CODEX_API_KEY=
# CTI_CODEX_BASE_URL=
# Allow Codex to run when CTI_DEFAULT_WORKDIR is not inside a trusted Git repo.
# Keep this off unless you intentionally want Codex to work in arbitrary folders.
# CTI_CODEX_SKIP_GIT_REPO_CHECK=true

# ── Telegram ──
CTI_TG_BOT_TOKEN=your-telegram-bot-token
# Chat ID for authorization (at least one of CHAT_ID or ALLOWED_USERS is required)
# Get it: send a message to the bot, then visit https://api.telegram.org/botYOUR_TOKEN/getUpdates
CTI_TG_CHAT_ID=your-chat-id
# CTI_TG_ALLOWED_USERS=user_id_1,user_id_2

# ── Discord ──
# CTI_DISCORD_BOT_TOKEN=your-discord-bot-token
# CTI_DISCORD_ALLOWED_USERS=user_id_1,user_id_2
# CTI_DISCORD_ALLOWED_CHANNELS=channel_id_1
# CTI_DISCORD_ALLOWED_GUILDS=guild_id_1

# ── Feishu / Lark ──
# CTI_FEISHU_APP_ID=your-app-id
# CTI_FEISHU_APP_SECRET=your-app-secret
# CTI_FEISHU_DOMAIN=https://open.feishu.cn
# CTI_FEISHU_ALLOWED_USERS=user_id_1,user_id_2

# ── QQ ──
# Required: obtain from https://q.qq.com/qqbot/openclaw
# CTI_QQ_APP_ID=your-qq-app-id
# CTI_QQ_APP_SECRET=your-qq-app-secret
# Allowed users — comma-separated user_openid values (NOT QQ numbers)
# CTI_QQ_ALLOWED_USERS=openid_1,openid_2
# Image input — set to false if the underlying provider doesn't support image input
# CTI_QQ_IMAGE_ENABLED=true
# Max image size in MB (default 20)
# CTI_QQ_MAX_IMAGE_SIZE=20

# ── WeChat / 微信 ──
# No static token is required here. Use the QR login helper to add accounts:
#   npm run weixin:login
# Optional protocol overrides (normally leave unset)
# CTI_WEIXIN_BASE_URL=https://ilinkai.weixin.qq.com
# CTI_WEIXIN_CDN_BASE_URL=https://novac2c.cdn.weixin.qq.com/c2c
# Enable inbound media download/processing for image/file/video messages.
# Voice messages do not use raw audio download/transcription here: the bridge
# only accepts WeChat-provided speech-to-text text and otherwise returns an error.
# (default false for safety in CLI setups)
# CTI_WEIXIN_MEDIA_ENABLED=false

# ── Permission ──
# Auto-approve all tool permission requests without user confirmation.
# Useful for channels that lack interactive permission UI (e.g. Feishu
# WebSocket long-connection mode, where there is no HTTP webhook to
# render clickable approve/deny buttons).
# ⚠️  Only enable this in trusted, access-controlled environments.
# CTI_AUTO_APPROVE=true