Primary product focus: continue live Codex coding sessions from Feishu.
Compatibility note: the installed skill name, command, and legacy data path
~/.claude-to-im/remain unchanged for now, so existing Codex workflows keep working while the product branding moves towardCodex to Feishu.Architecture note: broader IM and provider abstractions still exist in-tree, but they are compatibility or future-facing layers rather than the current product promise.
This project runs a local background daemon that binds a Feishu bot to Codex sessions. Messages from Feishu are forwarded into Codex, and Codex responses are pushed back as mobile-friendly cards and text updates.
You (Feishu)
-> Feishu bot + card callbacks
Local bridge daemon (Node.js)
-> Codex CLI / Codex SDK
Codex
-> reads and writes your workspace
The maintained path is Codex to Feishu. Anything else in the repository should be treated as reserved implementation space unless explicitly requested.
- Maintained now: Codex session continuation from Feishu
- Maintained now: project/session browsing, session binding, permission cards, streaming/status updates
- Compatibility only: legacy install path
claude-to-im - Compatibility only: generic adapter/provider abstractions still in-tree
- Not the current product promise: general-purpose multi-IM bridge positioning
- Feishu-first session control: project list, session list, open-session dock, and in-card session switching
- Codex-native workflow: forwards Feishu messages into live Codex sessions instead of creating a separate bot-only memory silo
- Permission flow for mobile: card approvals plus quick
1 / 2 / 3reply fallback - Persistent bindings: session bindings and mirrors survive bridge restarts
- Windows-friendly operations: PowerShell install, watchdog startup, dual-log diagnostics, service helpers
- Node.js >= 20
- Codex CLI: install with
npm install -g @openai/codex, then authenticate withcodex auth loginorOPENAI_API_KEY - Feishu app credentials: App ID + App Secret for a self-built app with bot capability enabled
Clone this repository:
git clone https://github.com/Nuctori/Codex2FeishuBot.git ~/code/Codex2FeishuBot
cd ~/code/Codex2FeishuBotWindows PowerShell:
git clone https://github.com/Nuctori/Codex2FeishuBot.git $env:USERPROFILE\code\Codex2FeishuBot
Set-Location $env:USERPROFILE\code\Codex2FeishuBotRun the local bootstrap:
npm run bootstrapWindows PowerShell:
npm run bootstrapThat command installs dependencies and builds the daemon. To also install the skill into Codex:
npm run bootstrap -- --installWindows PowerShell live-link install:
npm run bootstrap -- --install --linkThis repository is now much friendlier to other AI agents, but it still cannot do a perfect zero-human setup because Feishu platform operations remain external:
- A human must create the Feishu app and obtain
App ID/App Secret - A human must approve scopes, bot capability, callbacks, and version publish
- A human usually needs to provide a real
chat_idbefore an end-to-end send test can run
Once the repository checkout and credentials exist, an AI agent can automate local install, build, doctor, smoke tests, and Codex skill installation.
Install into Codex and keep using the legacy claude-to-im command name for compatibility.
For a full from-zero deployment and connection checklist, use references/zero-deploy-runbook.md.
npm run bootstrap -- --installWindows PowerShell:
npm run bootstrap -- --installnpm run bootstrap -- --install --linkWindows PowerShell:
npm run bootstrap -- --install --linkbash ./scripts/install-codex.shWindows PowerShell:
powershell -ExecutionPolicy Bypass -File .\scripts\install-codex.ps1git clone https://github.com/Nuctori/Codex2FeishuBot.git ~/.codex/skills/claude-to-im
cd ~/.codex/skills/claude-to-im
npm install
npm run buildThe install script places the skill under ~/.codex/skills/claude-to-im, installs dependencies, and builds the daemon.
After installation, tell Codex:
claude-to-im setup
Start a new Codex session and say claude-to-im setup, start bridge, or bridge status.
If you installed with the Codex install script in copy mode:
rm -rf ~/.codex/skills/claude-to-im
npm run bootstrap -- --installWindows PowerShell:
Remove-Item -Recurse -Force $env:USERPROFILE\.codex\skills\claude-to-im
npm run bootstrap -- --installIf you installed with --link or cloned directly into the Codex skills directory:
cd ~/.codex/skills/claude-to-im
git pull
npm install
npm run buildThen tell Codex:
claude-to-im doctor
start bridge
claude-to-im setup
The setup flow for the maintained product path covers:
- Feishu credentials: App ID, App Secret, domain, permissions, bot capability, callbacks
- Codex defaults: workspace, model, runtime mode
- Validation: configuration and connectivity checks before launch
start bridge
The daemon runs in the background, so your terminal can close after startup.
Open Feishu and send a message to your bot. Codex responses, tool progress, and permission prompts are returned through the bridge.
Full human + AI operator checklist: references/zero-deploy-runbook.md.
Use this when you want to verify a fresh install path without touching your real ~/.codex skill directory.
Local clean install + build only:
npm run smoke:deployReal Feishu credential connectivity, without sending a message:
npm run smoke:deploy -- --config ~/.claude-to-im/config.envFull end-to-end send test:
npm run smoke:deploy -- --config ~/.claude-to-im/config.env --chat-id <feishu_chat_id>The smoke script creates a temporary clean HOME, installs this checkout into .codex/skills/claude-to-im, runs npm ci --ignore-scripts --prefer-offline, builds the daemon, then optionally runs doctor plus a Feishu token, bot, and message-send check.
All commands are intended for Codex. The legacy command name is still claude-to-im.
| Command or phrase | Description |
|---|---|
claude-to-im setup / 配置桥接 |
Configure the Codex to Feishu bridge |
start bridge / 启动桥接 |
Start the background daemon |
stop bridge / 停止桥接 |
Stop the daemon |
bridge status / 查看桥接状态 |
Show daemon status |
logs / logs 200 / 查看日志 |
Show recent bridge logs |
reconfigure / 修改配置 |
Update bridge configuration |
doctor / 诊断桥接 |
Diagnose install or runtime issues |
The setup flow provides inline guidance. At a high level you need:
- Go to Feishu Open Platform or Lark Open Platform
- Create a custom app and copy App ID + App Secret
- Batch-add the permissions required by this bridge
- Enable the Bot capability
- Configure long-connection events and card callbacks
- Publish the app version and complete admin approval
If callbacks or permission cards fail after an upgrade, re-check scopes, callback registrations, and publish status first.
~/.claude-to-im/
├─ config.env
├─ data/
│ ├─ sessions.json
│ ├─ bindings.json
│ ├─ permissions.json
│ └─ messages/
├─ logs/
│ └─ bridge.log
└─ runtime/
├─ bridge.pid
└─ status.json
| Component | Role |
|---|---|
src/main.ts |
Daemon entry, dependency assembly, runtime startup |
src/config.ts |
Loads and persists bridge config |
src/store.ts |
JSON-backed bridge state storage |
src/codex-provider.ts |
Codex runtime integration |
src/permission-gateway.ts |
Permission request and approval bridge |
src/logger.ts |
Redacted rotating logs |
scripts/bootstrap.mjs |
AI-friendly one-command local bootstrap |
scripts/daemon.sh |
Start / stop / status / logs |
scripts/doctor.sh |
Health diagnostics |
scripts/smoke-deploy.mjs |
Clean temporary install and optional Feishu connectivity smoke |
scripts/feishu-smoke.mjs |
Feishu token, bot identity, and optional message-send check |
Run:
claude-to-im doctor
Common fixes:
- Re-run
setupif~/.claude-to-im/config.envis missing - Rebuild with
npm install && npm run buildif runtime files are stale - Re-check Feishu permissions, callbacks, and publish status if cards do not update
- Restart the daemon after config changes with
stop bridgethenstart bridge