codex-plugin-doctor

中文文档
1.91.0发布于 2026/11/03MITTypeScriptES Module构建来源已验证

用于Codex插件、技能和MCP包的CLI-first验证器具有运行时MCP协议验证。

中文使用文档
文档目录7 节
  1. 检查什么
  2. 安装
  3. GitHub行动
  4. 文档
  5. 1.0稳定
  6. 贡献
  7. 支持

Codex插件医生

CI npm version License: MIT GitHub release

在您发布Codex插件、技能和MCP服务器之前检查它们的CLI 包、它的安全性,以及(如果允许的话)正在运行的MCP服务器。

npx codex-plugin-doctor check path/to/plugin

指向一个文件夹 .codex-plugin/plugin.json. 在其 .mcp.json 退出时状态为1,报告如下(建议修改命令):

Codex Plugin Doctor
===================
Status: FAIL
Target: /path/to/plugin
Summary: 1 fail, 0 warn, 1 total

Failures
--------
✖ plugin.security.hard_coded_secret
  Message: The MCP server `dangerServer` contains a hard-coded secret-like env value for `OPENAI_API_KEY`.
  Impact: Hard-coded credentials inside plugin bundles increase leakage risk and make secure rotation difficult.
  Suggested fix: Replace the literal value for `OPENAI_API_KEY` with an environment reference or injected secret outside the package.
  Fingerprint: 21da7c75027f0811929d49253412a0f20694d974f141d0421410c89ee29c8b72
  Evidence: serverName=dangerServer, configPath=.mcp.json, envKey=OPENAI_API_KEY, envValue=[REDACTED]

添加 --runtime 也可以启动插件的MCP服务器并调用它们。它运行 包的自己的代码,所以它是可选的,和 --sandbox docker 隔离本地Node.js工作室 服务器。没有插件在手? npx codex-plugin-doctor check --installed 检查那些 在Codex插件缓存中。

检查什么

  • 包: .codex-plugin/plugin.json、技能布线及 SKILL.md 元数据, .mcp.json 结构、描述质量、硬编码的秘密和逃离包的路径。
  • 安全 (security .): shell包装器、编码命令、远程内容的记分卡 管道连接到shell中,以及普通HTTP传输。
  • 运行服务器 (--runtime): MCP握手,然后是工具、资源、提示和 分页,带有记分卡和一致性报告。
  • 突发的变化: MCP快照 比较工具、提示、 和资源模板与一个提交的基线,在拉请求评论和发布 笔记。
  • 其他客户 (compat . --all --scorecard): MCP配置是否有效,是否可以 添加到克劳德桌面,光标,克莱恩,和这台机器上的风帆。
  • 远程服务器和发布: 可选 远程MCP准备就绪, MCP注册表准备情况,以及离线 公共目录预飞行。

看到 CLI参考 有关更多命令和示例,请参见 codex-plugin-doctor --help 对他们所有人来说 codex-plugin-doctor explain <finding-id> 为 规则是什么意思。

安装

npm install -g codex-plugin-doctor
codex-plugin-doctor self-test
codex-plugin-doctor check .
codex-plugin-doctor check . --runtime
codex-plugin-doctor mcp path/to/mcp-package

GitHub行动

name: Validate Codex plugin

on:
  pull_request:

permissions:
  contents: read

jobs:
  doctor:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
        with:
          persist-credentials: false
      - uses: Esquetta/[email protected]
        with:
          version: "1.91.0"
          path: .
          runtime: "true"
          policy: codex-publish

runtime: "true" 运行包的代码,因此该作业保留一个只读令牌。 codex-plugin-doctor init-ci . 为您编写工作流。看到 GitHub动作用法 对于报告,拉取请求注释,和 输入。

文档

1.0稳定

1.0行是插件作者和CI消费者的稳定兼容性基准。

  • 公共JSON模式表面和现有规则id /默认严重性在1.0之前都被视为稳定的。
  • 运行时探测仍然是可选的,因为它执行包本地MCP服务器。
  • 除非主版本另有说明,否则新功能将保持添加状态。

看到 文档索引 有关架构、使用、安全性和贡献者指南。

贡献

欢迎投稿。开始 贡献, 安全策略, 行为准则,和 验证调优问题模板。 npm run release-check 运行释放预飞行;看到 版本控制和发布。

支持

如果这个工具节省了你的时间,GitHub的明星和赞助有助于表明项目值得继续下去。

  • 在GitHub上标记存储库。
  • 通过资源库资助链接使用GitHub赞助商。
  • 为假阳性或假阴性打开验证调优问题。

版本与发布记录

codex-plugin-doctor 共发布 131 个版本,首次发布于 2026/04/29;过去 12 个月发布了 131 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.91.0latest2026/11/03今天
1.90.12026/11/012 天前
1.90.02026/10/313 天前
1.89.02026/10/294 天前
1.88.02026/10/286 天前
1.87.02026/10/277 天前

其他发布通道:next → 1.0.0-rc.2。

关于 codex-plugin-doctor 的常见问题

codex-plugin-doctor 是什么?

用于Codex插件、技能和MCP包的CLI-first验证器具有运行时MCP协议验证。

如何安装 codex-plugin-doctor?

在项目目录运行 npm install codex-plugin-doctor,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 codex-plugin-doctor,可以用 npx codex-plugin-doctor 直接运行。

codex-plugin-doctor 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

codex-plugin-doctor 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

codex-plugin-doctor 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

codex-plugin-doctor 可以商用吗?

codex-plugin-doctor 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

codex-plugin-doctor 还在维护吗?

最新版本 1.91.0 发布于 2026/11/03(今天);至今共发布 131 个版本,其中过去 12 个月发布了 131 个;首次发布于 2026/04/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。