npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@arisilin/codex-im

v0.2.3

Published

Feishu-first local bridge for Codex.

Downloads

13

Readme

codex-im

本项目完全通过Vibe Coding实现,主要特点:手机聊的电脑能继续聊,电脑聊的手机也能继续聊。在手机上可以使用命令或飞书的卡片来进行交互,快速切换项目和线程

codex-im 是一个本地运行的飞书机器人桥接层:

飞书消息 -> 本机 codex app-server -> 飞书回复

Codex 操作都留在 本地,飞书只负责消息交互。

特性

  • 飞书长连接机器人
  • 普通对话回复
  • 卡片回复与流式更新
  • 先加表情、后输出正文
  • 回复到触发它的原消息
  • /codex bind 绑定项目
  • /codex where 查看当前项目/线程
  • /codex workspace 查看当前会话已记录项目和线程
  • /codex remove /绝对路径 移除会话绑定项目
  • /codex send <相对文件路径> 发送当前绑定项目内的文件
  • /codex switch <threadId> 切换线程
  • /codex message 查看最近几轮消息
  • /codex new 新建线程
  • /codex stop 停止当前运行
  • /codex model / /codex model update / /codex model <modelId> 查看可用模型、刷新可用模型以及推理强度、设置模型
  • /codex effort / /codex effort <low|medium|high|xhigh> 设置推理强度
  • /codex approve / /codex reject 审批卡片

安装

发布版安装:

npm install -g @arisilin/codex-im
codex-im feishu-bot

源码运行:

git clone [email protected]:Arisilin/codex-im.git
cd codex-im
npm install
npm run feishu-bot

执行脚本示例

#!/usr/bin/env bash
set -euo pipefail
npm install -g @arisilin/codex-im
codex-im feishu-bot

配置

有两个配置文件:.env 和 sessions.json

.env

程序会按这个顺序加载配置:

  1. 当前目录下的 .env
  2. ~/.codex-im/.env
  3. 当前 shell 环境变量

以下是默认读取 session 文件位置,也可以通过 .env 的配置指定

~/.codex-im/sessions.json

必填环境变量:

  • FEISHU_APP_ID
  • FEISHU_APP_SECRET
  • CODEX_IM_DEFAULT_CODEX_MODEL 新绑定项目时默认写入的模型(启动时会基于 Codex 可用模型列表校验,不合法则启动失败)
  • CODEX_IM_DEFAULT_CODEX_EFFORT 新绑定项目时默认写入的推理强度(启动时会基于对应模型可用推理强度校验,不合法则启动失败)
  • CODEX_IM_DEFAULT_CODEX_ACCESS_MODE 默认访问模式(必填:default / full-access

可选环境变量:

  • CODEX_IM_DEFAULT_WORKSPACE_ID 在session中读取当前绑定信息的key,更换key后,原来的信息虽然在session中,但是不会再读取
  • CODEX_IM_FEISHU_STREAMING_OUTPUT(默认 true,设为 false 则等 Codex 完成后一次性输出)
  • CODEX_IM_WORKSPACE_ALLOWLIST允许绑定的项目白名单
  • CODEX_IM_CODEX_ENDPOINT 用来指定 Codex 的远程 WebSocket RPC 地址,默认是启动本地服务
  • CODEX_IM_SESSIONS_FILE session文件路径

使用

全局安装后:

codex-im feishu-bot

源码运行时:

npm run feishu-bot

常用命令:

  • /codex bind /绝对路径
  • /codex where
  • /codex workspace
  • /codex remove /绝对路径
  • /codex send <相对文件路径>
  • /codex switch <threadId>
  • /codex message
  • /codex new
  • /codex stop
  • /codex model
  • /codex model update
  • /codex effort
  • /codex approve
  • /codex approve session
  • /codex reject
  • /codex help

项目与线程模型

  • 一个飞书会话可以记住多个项目
  • 每个项目对应一个当前选中的 Codex 线程
  • 历史线程列表以 Codex thread/list 为准
  • 切换项目或线程后,后续普通消息继续发到当前线程

工作方式

  • 收到用户消息后,先用表情标记正在处理
  • Codex 返回内容后,飞书中以卡片形式持续更新
  • 命令回执和普通对话都会优先回复到触发它的原消息
  • 审批请求会显示为交互卡片

开发

  • src/index.js: 启动入口
  • src/feishu-bot.js: 飞书机器人主逻辑
  • src/codex-rpc-client.js: Codex JSON-RPC 传输层
  • src/session-store.js: 会话绑定持久化
  • src/config.js: 环境变量配置

飞书配置

  1. 在飞书平台创建机器人

  2. 事件权限配置

| 名称 | 标识 | | --- | --- | | 消息被 reaction | im.message.reaction.created_v1 | | 消息被取消 reaction | im.message.reaction.deleted_v1 | | 接收消息 | im.message.receive_v1 |

  1. 回调配置

| 名称 | 标识 | | --- | --- | | 卡片回传交互 | card.action.trigger |

  1. 应用权限

| 名称 | 标识 | | --- | --- | | 获取卡片信息 | cardkit:card:read | | 创建与更新卡片 | cardkit:card:write | | 获取与更新用户基本信息 | contact:user.base:readonly | | 读取用户发给机器人的单聊消息 | im:message.p2p_msg:readonly | | 以应用身份发消息 | im:message:send_as_bot | | 发送删除表情回复 | im:message.reactions:write_only | | 获取与上传图片或文件资源 | im:resource |

参考项目

https://github.com/larksuite/openclaw-lark

https://github.com/Emanuele-web04/remodex

https://github.com/Dimillian/CodexMonitor