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

@xqli02/openmem

v0.1.2

Published

One-command bootstrap for using claude-mem/openmem in OpenCode with intranet npm registry support

Readme

openmem

把 OpenCode 里接入 claude-mem(openmem 插件)这件事,收敛成一条命令,尤其适配 IDC / 内网只能使用公司 npm 源的环境。

目标

  • 一键安装插件依赖
  • 自动修改 ~/.config/opencode/opencode.json
  • 自动兼容 plugin / plugins 两种配置写法
  • 支持 --registry 指定公司 npm 源

快速使用

方式 1:全局安装(目标形态)

npm i -g @xqli02/openmem
openmem --registry https://your.company.npm.registry/

方式 2:仓库本地验证

npm run test
node ./bin/openmem.js --registry https://your.company.npm.registry/

方式 3:从本仓库全局安装(发布前)

npm install -g .
openmem --registry https://your.company.npm.registry/

命令参数

  • --registry <url>:npm registry(IDC 推荐显式指定)
  • --package <name>:插件包名(默认 @xqli02/openmem
  • --opencode-dir <path>:OpenCode 配置目录(默认 ~/.config/opencode
  • --skip-install:仅写配置,不执行 npm install
  • --dry-run:只打印计划,不写文件
  • --no-backup:修改前不创建配置备份

它会做什么

  1. 定位 opencode.json
  2. 自动把插件加入:
    • 若存在 plugin 字段:追加 @xqli02/openmem@latest
    • 若存在 plugins 字段:追加 @xqli02/openmem
    • 若都不存在:创建 plugin 字段
  3. 执行 npm install(可带 --registry
  4. 提示重启 OpenCode 生效

验证建议

执行后检查:

  • ~/.config/opencode/opencode.json 已新增插件配置
  • ~/.config/opencode/package.json 有对应依赖
  • 重启 OpenCode 后插件可用

说明

这个 bootstrap 本身不依赖外部 API;网络只用于 npm 安装插件包。IDC 环境建议统一传入公司 npm 源参数。

Adapter 骨架(Phase 1 起步)

本仓库现在已包含 src/ 下的 OpenCode ↔ claude-mem adapter 骨架,便于后续逐步接入 claude-mem 全能力。

  • 插件入口:src/index.js
  • 生命周期 Hook:
    • experimental.chat.system.transformsrc/hooks/systemTransform.js
    • tool.execute.aftersrc/hooks/toolAfter.js
    • experimental.session.compactingsrc/hooks/sessionCompacting.js
  • 工具层:src/tools/memory{Search,Timeline,Detail,Save}.js
  • 后端抽象与选择:
    • src/backend/client.js
    • src/backend/mockBackend.js
    • src/backend/sdkAdapter.js(待接 claude-mem SDK)
    • src/backend/sidecarAdapter.js(待接 sidecar/worker)

环境变量(adapter)

  • OPENMEM_BACKEND=mock|sdk|sidecar(默认 sidecar
  • OPENMEM_TOKEN_BUDGET(默认 500
  • OPENMEM_MAX_TOPICS(默认 20
  • OPENMEM_SIDECAR_URL(默认 http://127.0.0.1:37777

当前版本是第一版可用适配:

  • sidecar 后端已实现 claude-mem worker 的核心接口对接(search/timeline/detail/save/capture/index)
  • sdk 模式当前委托给 sidecar(先保证可用性)
  • mock 后端保留用于离线联调和测试

claude-mem worker 前置

adapter 运行时需要 claude-mem worker 可访问(默认 127.0.0.1:37777)。

常见方式:

npx claude-mem install --ide opencode
npx claude-mem start

然后重启 OpenCode。