A local file-based bridge for real-time collaboration between Codex and DeepSeek Harness.
一个让 Codex 与 DeepSeek Harness 通过本地文件进行多轮实时协作的桥接工具。
- File-based message exchange without exposing network ports / 基于文件的消息交换,不暴露网络端口
- Multi-turn conversation protocol with
conversation_id,seq,message_id,reply_to/ 支持conversation_id、seq、message_id、reply_to的多轮对话协议 - Automatic DeepSeek API replies / 自动调用 DeepSeek API 回复
- Resident-session mode (A mode) for DeepSeek Harness / 支持 DeepSeek Harness 常驻会话 A 模式
- Deduplication, crash recovery and single-instance lock / 去重、断线恢复和单实例锁
- Progress sync every second / 每秒进度同步
- Windows EXE packaging support / 支持 Windows EXE 封装
Python 3.10+ is recommended. No third-party packages are required.
建议使用 Python 3.10+,本项目不需要第三方依赖。
All scripts resolve their data files from the project directory by default. Set
BRIDGE_DIR to keep runtime files elsewhere / 默认从项目目录读取和写入数据;可设置
BRIDGE_DIR 将运行数据放到其他目录。
Copy .env.example to .env and fill in your DeepSeek API Key:
cp .env.example .envDEEPSEEK_API_KEY=your_key_here
DEEPSEEK_MODEL=deepseek-chat
Start automatic API bridge / 启动自动 API 桥接:
python auto_bridge.pyStart resident A-mode bridge / 启动 A 模式常驻桥接:
python deepseek_bridge.pyUse the CLI / 使用命令行:
python bridge_cli.py auto
python bridge_cli.py resident
python bridge_cli.py status
python bridge_cli.py testBuild a Windows executable / 构建 Windows 可执行文件:
python -m PyInstaller --onefile --console --name DeepSeekBridge `
--hidden-import deepseek_bridge --hidden-import auto_bridge --hidden-import bridge_client `
bridge_cli.pyThe generated executable keeps data beside the EXE unless --data-dir is
provided / EXE 默认将数据保存在 EXE 同目录,也可用 --data-dir 指定目录。
bridge/
├── auto_bridge.py # Automatic DeepSeek API bridge / 自动 API 桥接
├── deepseek_bridge.py # A-mode resident bridge / A 模式常驻桥接
├── bridge_cli.py # Unified CLI / 统一命令行入口
├── bridge_client.py # Codex-side client / Codex 端客户端
├── progress_notifier.py # Progress sync every second / 每秒进度同步
├── PROTOCOL.md # Communication protocol / 通信协议
├── DeepSeekBridge.spec # PyInstaller spec / PyInstaller 打包配置
└── README.md
See PROTOCOL.md for the full protocol specification.
完整协议说明请查看 PROTOCOL.md。
- Never commit
.envor API keys / 不要提交.env或 API Key - The bridge only listens to local files, not network ports / 桥接只监听本地文件,不监听网络端口
- Use single-instance lock to prevent duplicate writers / 使用单实例锁防止重复写入
MIT License