doctor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDoctor Skill
诊断工具技能
Note: All paths in this guide respect when that environment variable is set.
~/.codex/...CODEX_HOME注意:当设置了环境变量时,本指南中所有的路径都会优先使用该环境变量的值。
CODEX_HOME~/.codex/...Task: Run Installation Diagnostics
任务:运行安装诊断
You are the OMX Doctor - diagnose and fix installation issues.
你是OMX诊断工具,负责诊断并修复安装问题。
Step 1: Check Plugin Version
步骤1:检查插件版本
bash
undefinedbash
undefinedGet installed version
Get installed version
INSTALLED=$(ls ~/.codex/plugins/cache/omc/oh-my-codex/ 2>/dev/null | sort -V | tail -1)
echo "Installed: $INSTALLED"
INSTALLED=$(ls ~/.codex/plugins/cache/omc/oh-my-codex/ 2>/dev/null | sort -V | tail -1)
echo "Installed: $INSTALLED"
Get latest from npm
Get latest from npm
LATEST=$(npm view oh-my-codex version 2>/dev/null)
echo "Latest: $LATEST"
**Diagnosis**:
- If no version installed: CRITICAL - plugin not installed
- If INSTALLED != LATEST: WARN - outdated plugin
- If multiple versions exist: WARN - stale cacheLATEST=$(npm view oh-my-codex version 2>/dev/null)
echo "Latest: $LATEST"
**诊断结果**:
- 未安装任何版本:严重 - 插件未安装
- 已安装版本 != 最新版本:警告 - 插件版本过旧
- 存在多个版本:警告 - 缓存过时Step 2: Check Hook Configuration (config.toml + legacy settings.json)
步骤2:检查钩子配置(config.toml + 旧版settings.json)
Check first (current Codex config), then check legacy only if it exists.
~/.codex/config.toml~/.codex/settings.jsonLook for hook entries pointing to removed scripts like:
bash $HOME/.codex/hooks/keyword-detector.shbash $HOME/.codex/hooks/persistent-mode.shbash $HOME/.codex/hooks/session-start.sh
Diagnosis:
- If found: CRITICAL - legacy hooks causing duplicates
首先检查(当前Codex配置),仅当旧版存在时再检查该文件。
~/.codex/config.toml~/.codex/settings.json查找指向已移除脚本的钩子条目,例如:
bash $HOME/.codex/hooks/keyword-detector.shbash $HOME/.codex/hooks/persistent-mode.shbash $HOME/.codex/hooks/session-start.sh
诊断结果:
- 如找到上述条目:严重 - 旧版钩子会导致重复执行问题
Step 3: Check for Legacy Bash Hook Scripts
步骤3:检查旧版Bash钩子脚本
bash
ls -la ~/.codex/hooks/*.sh 2>/dev/nullDiagnosis:
- If ,
keyword-detector.sh,persistent-mode.sh, orsession-start.shexist: WARN - legacy scripts (can cause confusion)stop-continuation.sh
bash
ls -la ~/.codex/hooks/*.sh 2>/dev/null诊断结果:
- 如存在、
keyword-detector.sh、persistent-mode.sh或session-start.sh:警告 - 旧版脚本(可能造成使用混淆)stop-continuation.sh
Step 4: Check AGENTS.md
步骤4:检查AGENTS.md
bash
undefinedbash
undefinedCheck if AGENTS.md exists
Check if AGENTS.md exists
ls -la ~/.codex/AGENTS.md 2>/dev/null
ls -la ~/.codex/AGENTS.md 2>/dev/null
Check for OMX marker
Check for OMX marker
grep -q "oh-my-codex Multi-Agent System" ~/.codex/AGENTS.md 2>/dev/null && echo "Has OMX config" || echo "Missing OMX config"
**Diagnosis**:
- If missing: CRITICAL - AGENTS.md not configured
- If missing OMX marker: WARN - outdated AGENTS.mdgrep -q "oh-my-codex Multi-Agent System" ~/.codex/AGENTS.md 2>/dev/null && echo "Has OMX config" || echo "Missing OMX config"
**诊断结果**:
- 如文件不存在:严重 - AGENTS.md未配置
- 如缺少OMX标记:警告 - AGENTS.md版本过旧Step 5: Check for Stale Plugin Cache
步骤5:检查过时的插件缓存
bash
undefinedbash
undefinedCount versions in cache
Count versions in cache
ls ~/.codex/plugins/cache/omc/oh-my-codex/ 2>/dev/null | wc -l
**Diagnosis**:
- If > 1 version: WARN - multiple cached versions (cleanup recommended)ls ~/.codex/plugins/cache/omc/oh-my-codex/ 2>/dev/null | wc -l
**诊断结果**:
- 如版本数>1:警告 - 存在多个缓存版本(建议清理)Step 6: Check for Legacy Curl-Installed Content
步骤6:检查旧版Curl安装的内容
Check for legacy agents, commands, and historical legacy skill roots from older installs/migrations:
bash
undefined检查旧版安装/迁移遗留的旧版agents、commands和历史旧版skill根目录:
bash
undefinedCheck for legacy agents directory
Check for legacy agents directory
ls -la ~/.codex/agents/ 2>/dev/null
ls -la ~/.codex/agents/ 2>/dev/null
Check for legacy commands directory
Check for legacy commands directory
ls -la ~/.codex/commands/ 2>/dev/null
ls -la ~/.codex/commands/ 2>/dev/null
Check canonical current skills directory
Check canonical current skills directory
ls -la ${CODEX_HOME:-~/.codex}/skills/ 2>/dev/null
ls -la ${CODEX_HOME:-~/.codex}/skills/ 2>/dev/null
Check historical legacy skill directory
Check historical legacy skill directory
ls -la ~/.agents/skills/ 2>/dev/null
**Diagnosis**:
- If `~/.codex/agents/` exists with oh-my-codex-related files: WARN - legacy agents (now provided by plugin)
- If `~/.codex/commands/` exists with oh-my-codex-related files: WARN - legacy commands (now provided by plugin)
- If `${CODEX_HOME:-~/.codex}/skills/` exists with OMX skills: OK - canonical current user skill root
- If `~/.agents/skills/` exists: WARN - historical legacy skill root that can overlap with `${CODEX_HOME:-~/.codex}/skills/` and cause duplicate Enable/Disable Skills entries
Look for files like:
- `architect.md`, `researcher.md`, `explore.md`, `executor.md`, etc. in agents/
- `ultrawork.md`, `deepsearch.md`, etc. in commands/
- Any oh-my-codex-related `.md` files in skills/
---ls -la ~/.agents/skills/ 2>/dev/null
**诊断结果**:
- 如`~/.codex/agents/`存在且包含oh-my-codex相关文件:警告 - 旧版agents(现在已由插件提供)
- 如`~/.codex/commands/`存在且包含oh-my-codex相关文件:警告 - 旧版commands(现在已由插件提供)
- 如`${CODEX_HOME:-~/.codex}/skills/`存在且包含OMX技能:正常 - 标准的当前用户技能根目录
- 如`~/.agents/skills/`存在:警告 - 历史遗留的旧版技能根目录,可能与`${CODEX_HOME:-~/.codex}/skills/`冲突,导致技能启用/禁用条目重复
查找以下类型的文件:
- agents/目录下的`architect.md`、`researcher.md`、`explore.md`、`executor.md`等
- commands/目录下的`ultrawork.md`、`deepsearch.md`等
- skills/目录下任何与oh-my-codex相关的`.md`文件
---Report Format
报告格式
After running all checks, output a report:
undefined运行所有检查后,输出如下报告:
undefinedOMX Doctor Report
OMX诊断工具报告
Summary
概要
[HEALTHY / ISSUES FOUND]
[正常 / 发现问题]
Checks
检查项
| Check | Status | Details |
|---|---|---|
| Plugin Version | OK/WARN/CRITICAL | ... |
| Hook Config (config.toml / legacy settings.json) | OK/CRITICAL | ... |
| Legacy Scripts (~/.codex/hooks/) | OK/WARN | ... |
| AGENTS.md | OK/WARN/CRITICAL | ... |
| Plugin Cache | OK/WARN | ... |
| Legacy Agents (~/.codex/agents/) | OK/WARN | ... |
| Legacy Commands (~/.codex/commands/) | OK/WARN | ... |
| Skills (${CODEX_HOME:-~/.codex}/skills) | OK/WARN | ... |
| Legacy Skill Root (~/.agents/skills) | OK/WARN | ... |
| 检查项 | 状态 | 详情 |
|---|---|---|
| 插件版本 | 正常/警告/严重 | ... |
| 钩子配置(config.toml / 旧版settings.json) | 正常/严重 | ... |
| 旧版脚本(~/.codex/hooks/) | 正常/警告 | ... |
| AGENTS.md | 正常/警告/严重 | ... |
| 插件缓存 | 正常/警告 | ... |
| 旧版Agents(~/.codex/agents/) | 正常/警告 | ... |
| 旧版Commands(~/.codex/commands/) | 正常/警告 | ... |
| 技能目录(${CODEX_HOME:-~/.codex}/skills) | 正常/警告 | ... |
| 旧版技能根目录(~/.agents/skills) | 正常/警告 | ... |
Issues Found
发现的问题
- [Issue description]
- [Issue description]
- [问题描述]
- [问题描述]
Recommended Fixes
建议修复方案
[List fixes based on issues]
---[根据发现的问题列出修复方法]
---Auto-Fix (if user confirms)
自动修复(需用户确认)
If issues found, ask user: "Would you like me to fix these issues automatically?"
If yes, apply fixes:
如果发现问题,询问用户:"你希望我自动修复这些问题吗?"
如果用户同意,执行以下修复:
Fix: Legacy Hooks in legacy settings.json
修复:旧版settings.json中的旧版钩子
If exists, remove the legacy section (keep other settings intact).
~/.codex/settings.json"hooks"如果存在,删除旧版的部分(保留其他设置不变)。
~/.codex/settings.json"hooks"Fix: Legacy Bash Scripts
修复:旧版Bash脚本
bash
rm -f ~/.codex/hooks/keyword-detector.sh
rm -f ~/.codex/hooks/persistent-mode.sh
rm -f ~/.codex/hooks/session-start.sh
rm -f ~/.codex/hooks/stop-continuation.shbash
rm -f ~/.codex/hooks/keyword-detector.sh
rm -f ~/.codex/hooks/persistent-mode.sh
rm -f ~/.codex/hooks/session-start.sh
rm -f ~/.codex/hooks/stop-continuation.shFix: Outdated Plugin
修复:版本过旧的插件
bash
rm -rf ~/.codex/plugins/cache/omc/oh-my-codex
echo "Plugin cache cleared. Restart Codex CLI to fetch latest version."bash
rm -rf ~/.codex/plugins/cache/omc/oh-my-codex
echo "Plugin cache cleared. Restart Codex CLI to fetch latest version."Fix: Stale Cache (multiple versions)
修复:过时缓存(多个版本)
bash
undefinedbash
undefinedKeep only latest version
Keep only latest version
cd ~/.codex/plugins/cache/omc/oh-my-codex/
ls | sort -V | head -n -1 | xargs rm -rf
undefinedcd ~/.codex/plugins/cache/omc/oh-my-codex/
ls | sort -V | head -n -1 | xargs rm -rf
undefinedFix: Missing/Outdated AGENTS.md
修复:缺失/版本过旧的AGENTS.md
Fetch latest from GitHub and write to :
~/.codex/AGENTS.mdWebFetch(url: "https://raw.githubusercontent.com/Yeachan-Heo/oh-my-codex/main/docs/AGENTS.md", prompt: "Return the complete raw markdown content exactly as-is")从GitHub拉取最新版本并写入:
~/.codex/AGENTS.mdWebFetch(url: "https://raw.githubusercontent.com/Yeachan-Heo/oh-my-codex/main/docs/AGENTS.md", prompt: "Return the complete raw markdown content exactly as-is")Fix: Legacy Curl-Installed Content
修复:旧版Curl安装的内容
Remove legacy agents/commands plus the historical tree if it overlaps with the canonical install:
~/.agents/skills${CODEX_HOME:-~/.codex}/skillsbash
undefined如果旧版agents/commands以及历史目录与标准的安装冲突,删除这些内容:
~/.agents/skills${CODEX_HOME:-~/.codex}/skillsbash
undefinedBackup first (optional - ask user)
先备份(可选 - 询问用户)
mv ~/.codex/agents ~/.codex/agents.bak
mv ~/.codex/agents ~/.codex/agents.bak
mv ~/.codex/commands ~/.codex/commands.bak
mv ~/.codex/commands ~/.codex/commands.bak
mv ~/.agents/skills ~/.agents/skills.bak
mv ~/.agents/skills ~/.agents/skills.bak
Or remove directly
或者直接删除
rm -rf ~/.codex/agents
rm -rf ~/.codex/commands
rm -rf ~/.agents/skills
**Note**: Only remove if these contain oh-my-codex-related files. If user has custom agents/commands/skills, warn them and ask before removing.
---rm -rf ~/.codex/agents
rm -rf ~/.codex/commands
rm -rf ~/.agents/skills
**注意**:仅当这些目录包含oh-my-codex相关文件时再删除。如果用户有自定义的agents/commands/skills,删除前需警告用户并征得同意。
---Post-Fix
修复后操作
After applying fixes, inform user:
Fixes applied. Restart Codex CLI for changes to take effect.
应用修复后,告知用户:
修复已完成。请重启Codex CLI使更改生效。