Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ tools/ctf-website/_downloads/

# Local agent / IDE config (not part of public release)
.codex/
.codex_local/
.open-reverselab-local/
.claude/settings.local.json
.serena/

Expand Down
15 changes: 15 additions & 0 deletions CODEX.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@echo off
setlocal
chcp 65001 >nul
cd /d "%~dp0"

powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0\scripts\codex\codex_entry.ps1"
set "EXIT_CODE=%ERRORLEVEL%"

echo.
if not "%EXIT_CODE%"=="0" (
echo CODEX.bat exited with code: %EXIT_CODE%
)
echo.
pause
exit /b %EXIT_CODE%
15 changes: 15 additions & 0 deletions LAUNCHER.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@echo off
setlocal
chcp 65001 >nul
cd /d "%~dp0"

powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0\scripts\codex\launcher_entry.ps1"
set "EXIT_CODE=%ERRORLEVEL%"

echo.
if not "%EXIT_CODE%"=="0" (
echo LAUNCHER.bat exited with code: %EXIT_CODE%
)
echo.
pause
exit /b %EXIT_CODE%
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ uv run --project tools/skills/mcp/ReverseLabToolsMCP python scripts/misc/mcp_smo
6. Create a task: `python scripts/misc/new_task.py --board ctf-website --name <name>`.
7. After moving machines or changing MCP settings, run `uv run --project tools/skills/mcp/ReverseLabToolsMCP python scripts/misc/mcp_smoke_check.py --write-report` and confirm MCP tool calls pass.

## Optional Codex Launcher

If you use Codex and want a dedicated entrypoint, use `CODEX.bat`. It installs
or repairs the global `open_reverselab_codex` MCP adapter for Codex and lets
you bind other projects to project-scoped open-reverselab mode.

`LAUNCHER.bat` is an optional umbrella menu. Its `Codex` entry opens the same
Codex adapter workflow. Its `Claude` and `Other CLI` entries currently
delegate back to the upstream `START_HERE` flow rather than installing a new
multi-CLI adapter.

For details, see [docs/codex/CODEX_ONLY.md](docs/codex/CODEX_ONLY.md).

Post-install verification:

```powershell
Expand Down
12 changes: 12 additions & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ uv run --project tools/skills/mcp/ReverseLabToolsMCP python scripts/misc/mcp_smo
6. 创建任务:`python scripts/misc/new_task.py --board ctf-website --name <name>`。
7. 每次换机器或重配 MCP 后,运行 `uv run --project tools/skills/mcp/ReverseLabToolsMCP python scripts/misc/mcp_smoke_check.py --write-report`,确认 MCP 真实可调用。

## 可选 Codex 入口

如果你主要使用 Codex,并且想要单独的 Codex 入口,优先使用 `CODEX.bat`。
它会为 Codex 安装或修复全局 `open_reverselab_codex` MCP 适配层,并允许你把
其他项目绑定到项目级 open-reverselab 模式。

`LAUNCHER.bat` 是可选总入口。它的 `Codex` 菜单会进入同一套 Codex 适配流
程;`Claude` 和 `其他 CLI` 菜单目前只是回到原版 `START_HERE` 流程,并不
代表本仓库已经额外实现了一套新的多 CLI 适配层。

详细说明见 [docs/codex/CODEX_USAGE.zh-CN.md](docs/codex/CODEX_USAGE.zh-CN.md)。

## 迭代模式

```
Expand Down
45 changes: 45 additions & 0 deletions docs/codex/CODEX_ONLY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Codex-only local tooling

This local toolset is for Codex only.

Use these root-level launchers:

- `CODEX.bat`
- `LAUNCHER.bat`

What it does:

- registers the global Codex MCP server `open_reverselab_codex`
- merges a managed global Codex developer-instructions block
- preserves any existing workspace `.codex/config.toml`
- lets you bind other projects to open-reverselab Codex mode
- creates per-project `.codex/` runtime files when a target project is bound
- stores local adapter state, reports, and backups under `.open-reverselab-local/`

What it does not do:

- it does not replace the upstream `START_HERE.bat`
- it does not modify the repo-local upstream `.mcp.json`
- it does not manage `.claude/`
- `LAUNCHER.bat` routes its `Claude` and `Other CLI` entries back to the
upstream `START_HERE` flow; this adapter only adds a real Codex integration
path

Recommended flow:

- run `CODEX.bat`
- choose `1. 安装/修复 全局 Codex MCP`
- restart Codex App and Codex CLI
- open the real target project
- say `启用 open-reverselab Codex 模式`
- confirm the previewed changes when asked

Project outputs:

- `.codex/`
- `.open-reverselab-codex/`
- `notes/open-reverselab/`
- `reports/open-reverselab/`
- `exports/open-reverselab/`
- `patches/open-reverselab/` on demand
- `projects/open-reverselab/` on demand
233 changes: 233 additions & 0 deletions docs/codex/CODEX_USAGE.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
# open-reverselab Codex 使用说明

## 1. 这套东西现在怎么理解

- `START_HERE.bat`
- 原作者入口。
- 继续保留。
- 主要给原版流程 / 其他 CLI 用。

- `LAUNCHER.bat`
- 总工作台入口。
- 用于在 `Codex / Claude / 其他 CLI / 全部` 之间分流。
- 其中 `Claude` 和 `其他 CLI` 当前只是回到原版 `START_HERE` 流程。

- `CODEX.bat`
- 现在唯一的 Codex 专用入口。
- 启动时会先做一轮快速检查。
- 关于 Codex 的安装、修复、项目管理、备份恢复,都从这里进入。

## 2. 第一次使用

按这个顺序来:

1. 双击 `CODEX.bat`
2. 选 `1. 安装/修复 全局 Codex MCP`
3. 等它完成
4. 完全关闭并重新打开 `Codex App`
5. 如果你也用 `Codex CLI`,也重新开一次
6. 打开你真正要工作的目标项目
7. 在那个项目的 Codex 会话里输入:

```text
启用 open-reverselab Codex 模式
```

首次接入时:

- 会先预览要改哪些文件
- 会要求你输入精确确认短语
- 确认后才会真正写入
- 会在目标项目生成 `.codex/` 受管运行层

## 3. 日常使用

### 3.1 启用当前项目

在目标项目会话里输入:

```text
启用 open-reverselab Codex 模式
```

英文也可以:

```text
enable open-reverselab codex mode
```

### 3.2 查看当前项目状态

```text
查看 open-reverselab Codex 状态
```

或:

```text
show open-reverselab codex status
```

### 3.3 停用当前项目

```text
停用 open-reverselab Codex 模式
```

或:

```text
disable open-reverselab codex mode
```

## 4. 产物会写到哪里

绑定成功后,当前项目会生成这些目录:

- `.codex/`
- `.open-reverselab-codex/`
- `notes/open-reverselab/`
- `reports/open-reverselab/`
- `exports/open-reverselab/`

按需才会出现这些目录:

- `patches/open-reverselab/`
- `projects/open-reverselab/`
- `samples/open-reverselab/`
- `cases/open-reverselab/`

这表示:

- 产物写回当前项目
- 不再默认写回 `open-reverselab` 仓库本身

## 5. 如果你要手动管理别的项目

运行 `CODEX.bat`,进入:

- `4. 项目管理`

里面可以做:

- 绑定指定项目
- 查看指定项目状态
- 修复指定项目接入
- 解绑指定项目

适合这几种情况:

- 某个项目的接入状态乱了
- 你想手工给另一个项目接入
- 你想不用会话命令,直接从菜单修复

## 6. 备份和恢复

运行 `CODEX.bat`,进入:

- `5. 备份 / 恢复`

这里恢复的是:

- 接入配置
- 接入状态
- 受管块
- 本地注册表

这里不会恢复或覆盖:

- 分析报告
- 导出文件
- 业务产物

也就是说:

- 恢复接入状态
- 不碰你的分析结果

## 7. 当前会改哪些全局内容

安装后会改:

- 用户目录下的 `.codex/config.toml`

会加入:

- 全局 MCP:`open_reverselab_codex`
- 全局说明层:识别启用 / 停用 / 状态 这几句固定短语

不会再依赖:

- 工作区 `.codex/config.toml` 的删除式改动

并且:

- 如果当前仓库本身已经有 `.codex/config.toml`,会保留,不会被 `CODEX.bat` 删除

## 8. 当前项目里会写哪些说明文件

项目第一次绑定后,会在项目里生成:

- `.open-reverselab-codex/README.md`
- `.open-reverselab-codex/QUICK_START.md`
- `.open-reverselab-codex/TASK_TEMPLATE.md`
- `.codex/config.toml`
- `.codex/open-reverselab.config.toml`
- `.codex/open-reverselab.ctf.config.toml`
- `.codex/open-reverselab.ctf_optimized.md`

如果项目里没有 `AGENTS.md`,会创建最小版。

如果有 `AGENTS.md`,会在文件末尾追加一个受管块。

停用时:

- 会移除 `.codex/config.toml` 里的 open-reverselab 受管块
- 但默认保留 `.codex/` 里的这些文件,方便后续重新启用或排查

## 9. 最短使用口诀

只记这一套就够了:

1. `CODEX.bat`
2. `1. 安装/修复 全局 Codex MCP`
3. 重启 Codex
4. 打开目标项目
5. 会话里输入:`启用 open-reverselab Codex 模式`

## 10. 常见问题

### Q1. 以后还要先启动很多 BAT 吗?

不用。

关于 Codex,只认:

- `CODEX.bat`
- 如果你想通过总菜单来选入口,再用:
- `LAUNCHER.bat`

### Q2. `START_HERE.bat` 还要不要用?

如果你是走原作者原版流程 / 其他 CLI,可以继续用。

如果你现在只是在做 Codex 这套,就优先用:

- `CODEX.bat`

### Q3. 如果 Codex 里还显示旧 MCP 怎么办?

先做这几个动作:

1. 运行 `CODEX.bat`
2. 选 `2. 启动前自检 / 状态查看`
3. 完全关闭并重新打开 Codex App

### Q4. 怎么知道当前项目已经接入成功?

看两处:

1. 会话里输入:
- `查看 open-reverselab Codex 状态`
2. 当前项目里是否存在:
- `.open-reverselab-codex/`
Loading