ideabrowser.com — find trending startup ideas with real demand
Try itnpx skills add https://github.com/op7418/claude-to-im-skill --skill claude-to-imYou are managing the Claude-to-IM bridge.
User data is stored at ~/.claude-to-im/.
The skill directory (SKILL_DIR) is at ~/.claude/skills/claude-to-im.
If that path doesn't exist, fall back to Glob with pattern **/skills/**/claude-to-im/SKILL.md and derive the root from the result.
Parse the user's intent from $ARGUMENTS into one of these subcommands:
| User says (examples) | Subcommand |
|---|---|
setup, configure, 配置, 我想在飞书上用 Claude, 帮我连接 Telegram | setup |
start, start bridge, 启动, 启动桥接 | start |
stop, stop bridge, 停止, 停止桥接 | stop |
status, bridge status, 状态, 运行状态, 怎么看桥接的运行状态 | status |
logs, logs 200, 查看日志, 查看日志 200 | logs |
reconfigure, 修改配置, 帮我改一下 token, 换个 bot | reconfigure |
doctor, diagnose, 诊断, 挂了, 没反应了, bot 没反应, 出问题了 | doctor |
Disambiguation: status vs doctor — Use status when the user just wants to check if the bridge is running (informational). Use doctor when the user reports a problem or suspects something is broken (diagnostic). When in doubt and the user describes a symptom (e.g., "没反应了", "挂了"), prefer doctor.
Extract optional numeric argument for logs (default 50).
Before asking users for any platform credentials, read SKILL_DIR/references/setup-guides.md internally so you know where to find each credential. Do NOT dump the full guide to the user upfront — only mention the specific next step they need to do (e.g., "Go to https://open.feishu.cn → your app → Credentials to find the App ID"). If the user says they don't know how, then show the relevant section of the guide.
Before executing any subcommand, detect which environment you are running in:
AskUserQuestion tool is available. Use it for interactive setup wizards.AskUserQuestion is NOT available. Fall back to non-interactive guidance: explain the steps, show SKILL_DIR/config.env.example, and ask the user to create ~/.claude-to-im/config.env manually.You can test this by checking if AskUserQuestion is in your available tools list.
start, stop, status, logs, reconfigure, doctor)Before running any subcommand other than setup, check if ~/.claude-to-im/config.env exists:
setup wizard using AskUserQuestion.~/.claude-to-im/config.env based on the example:" then show the contents of SKILL_DIR/config.env.example and stop. Don't attempt to start the daemon — without config.env the process will crash on startup and leave behind a stale PID file that blocks future starts.setupRun an interactive setup wizard. This subcommand requires AskUserQuestion. If it is not available (Codex environment), instead show the contents of SKILL_DIR/config.env.example with field-by-field explanations and instruct the user to create the config file manually.
When AskUserQuestion IS available, collect input one field at a time. After each answer, confirm the value back to the user (masking secrets to last 4 chars only) before moving to the next question.
Step 1 — Choose channels
Ask which channels to enable (telegram, discord, feishu, qq). Accept comma-separated input. Briefly describe each:
/perm ... commands.Step 2 — Collect tokens per channel
For each enabled channel, collect one credential at a time. Tell the user where to find each value in one sentence. Only show the full guide section (from SKILL_DIR/references/setup-guides.md) if the user asks for help or says they don't know how:
/claude-to-im start, (E) configure events (im.message.receive_v1) and callback (card.action.trigger) with long connection mode, (F) publish second version + admin approve.user_openid, NOT QQ number. If the user doesn't have openid yet, they can leave it empty.Step 3 — General settings
Ask for runtime, default working directory, model, and mode:
claude (default), codex, auto
claude — uses Claude Code CLI + Claude Agent SDK (requires claude CLI installed)codex — uses OpenAI Codex SDK (requires codex CLI; auth via codex auth login or OPENAI_API_KEY)auto — tries Claude first, falls back to Codex if Claude CLI not found$CWDcode (default), plan, askStep 4 — Write config and validate
mkdir -p ~/.claude-to-im/{data,logs,runtime,data/messages}~/.claude-to-im/config.env with all settings in KEY=VALUE formatchmod 600 ~/.claude-to-im/config.envSKILL_DIR/references/token-validation.md for the exact commands and expected responses for each platform. This catches typos and wrong credentials before the user tries to start the daemon./claude-to-im start to start the bridge."startPre-check: Verify ~/.claude-to-im/config.env exists (see "Config check" above). Without it, the daemon will crash immediately and leave a stale PID file.
Run: bash "SKILL_DIR/scripts/daemon.sh" start
Show the output to the user. If it fails, tell the user:
doctor to diagnose: /claude-to-im doctor/claude-to-im logsstopRun: bash "SKILL_DIR/scripts/daemon.sh" stop
statusRun: bash "SKILL_DIR/scripts/daemon.sh" status
logsExtract optional line count N from arguments (default 50).
Run: bash "SKILL_DIR/scripts/daemon.sh" logs N
reconfigure~/.claude-to-im/config.envSKILL_DIR/references/setup-guides.md if they ask for help/claude-to-im stop then /claude-to-im start to apply the changes."doctorRun: bash "SKILL_DIR/scripts/doctor.sh"
Show results and suggest fixes for any failures. Common fixes:
cd SKILL_DIR && npm installcd SKILL_DIR && npm run buildsetupFor more complex issues (messages not received, permission timeouts, high memory, stale PID files), read SKILL_DIR/references/troubleshooting.md for detailed diagnosis steps.
Feishu upgrade note: If the user upgraded from an older version of this skill and Feishu is returning permission errors (e.g. streaming cards not working, typing indicators failing, permission buttons unresponsive), the root cause is almost certainly missing permissions or callbacks in the Feishu backend. Refer the user to the "Upgrading from a previous version" section in SKILL_DIR/references/setup-guides.md — they need to add new scopes (cardkit:card:write, cardkit:card:read, im:message:update, im:message.reactions:read, im:message.reactions:write_only), add the card.action.trigger callback, and re-publish the app. The upgrade requires two publish cycles because adding the callback needs an active WebSocket connection (bridge must be running).
~/.claude-to-im/config.env — survives across sessions.