dsh-codex-sync
连接与集成Walvez/dsh-codex-sync
一键将 Codex 迁移到 DSH:自动导入项目聊天,并提供技能和 MCP 双向同步。
- codex
- cordis
- deepseek
- deepseek-harness
- developer-tools
- dsh
- dsh-plugin
- import
- mcp
- model-context-protocol
- openai-codex
- sync
README
⚡ dsh-codex-sync
One-tap Codex move-in to DSH: auto-import project chats, two-way Skills & MCP sync.
🚀 Key Capabilities
- ✨ Live Skills Bridge: Registers
~/.codex/skills/*/SKILL.mddirectly into DSH's native skill catalog. Edit a file, and the next scan picks it up instantly—no copy, no drift. - 🤖 Bundled
codex-syncAgent Skill: Ships an out-of-the-box skill so your DSH agent can dry-run imports, toggle sync features, and inspect MCP status autonomously. - 💬 Smart Session History Importer: Click Import now to open an interactive dialog grouped by project with instant search, sub-agent nesting, and re-import support for continued threads.
- 🔌 Full MCP Auto-Mirroring:
- Codex → DSH: Dynamically mirrors
[mcp_servers.*]fromconfig.tomlwith live file watching. - DSH → Codex: Wires
[mcp_servers.dsh-plugins]so Codex can discover, inspect, and install DSH plugins via reverse MCP.
- Codex → DSH: Dynamically mirrors
- 🌓 Native Dark & Light Theme: Seamlessly adapts to DSH design tokens (
--dsw-alias-*) with crisp vector icons, smooth toggles, and hover tooltips (ⓘ).
📦 Quick Start
1. DSH Setup
Install via DSH Plugin Market (recommended):
dsh plugin --profile web add dsh-codex-sync
Or mount via cordis.patch.yml:
- insert:
- id: codex-sync
name: dsh-codex-sync
config:
maxSkills: 30
mcpMirrorDeny:
- node_repl
mcpMirrorSilent:
- exa
2. Codex Setup (Reverse MCP Bridge)
# Configure [mcp_servers.dsh-plugins] into ~/.codex/config.toml
npx dsh-codex-sync codex-install
# Check synchronization health
dsh-codex-sync doctor
🎛️ In-Composer GUI Settings
Click Sync ▾ in the composer tool row to access the control panel. Switches reflect live state and persist across sessions.
| Group | Item | Action / Key | Description |
|---|---|---|---|
| Actions | Import now | /import-all | Open project picker & import chats |
| Mirror status | /mcp-status | Display per-server mirror health & reasons | |
| Refresh states | /codex-settings | Re-read all switch states from host | |
| Features | Import commands | enableImport | Enable /import-codex command family |
| Auto import | autoImport | Import new sessions automatically on startup | |
| Instructions | enableInstructions | Inject instructions.md / AGENTS.md into prompt | |
| Config summary | enableConfig | Inject config.toml model summary into prompt | |
| Skills | enableSkills | Register ~/.codex/skills as live DSH skills | |
| MCP mirror | mcpMirror | Auto-mirror [mcp_servers.*] to DSH | |
| Language | English ⇄ 中文 | Language | Switch GUI language (persisted in localStorage) |
💡 Hover over the ⓘ icon next to any item to view its detailed explainer.
⚡ Slash Commands
| Command | Arguments | Description |
|---|---|---|
/import-codex | [--dry-run] [--ids a,b] [--limit N] [--project str] [--since date] [--include-subagents] | Import Codex sessions (dry-run prints [would-import], writes nothing) |
/import-all | (Same as above) | Alias of /import-codex |
/attach-workspaces | None | Re-attach all imported sessions to matching CWD workspaces |
/mcp-status | None | Display real-time status and reasons for all MCP servers |
/auto-import | [on|off] | Toggle auto-import on startup (query without args) |
/codex-settings | None | Print all feature switches and effective states |
/codex-setting | <key> [on|off] | Toggle specific sync features via command line |
⚙️ Configuration Reference
| Option | Default | Description |
|---|---|---|
codexHome | ~/.codex | Codex configuration directory |
enableSkills | true | Register Codex skills as first-class DSH skills |
enableInstructions | true | Inject instructions.md / AGENTS.md into prompt |
enableConfig | true | Inject config.toml model summary into prompt |
enableImport | true | Register /import-codex command family |
maxSkills | 100 | Max number of skills to scan and register |
maxSessionBytes | 268435456 (256MB) | Skip rollouts larger than this limit to prevent V8 string crashes |
importSubagents | false | When true, imports sub-agent rollout threads (parent_thread_id) |
mcpMirror | true | Auto-mirror [mcp_servers.*] from config.toml |
mcpMirrorDeny | [] | Blacklist of server names never to mirror (dsh-plugins excluded) |
mcpMirrorOnly | None | Whitelist: if set, mirrors only these specified server names |
mcpMirrorSilent | [] | Stdio servers started with 2>/dev/null to silence chatty stderr logs |
autoImport | false | Run incremental import automatically on startup session |
📋 Compatibility Matrix
See docs/compat.md for details on skills, instructions, MCP, sessions, and delta updates.
🧪 Testing
npm test
Hermetic test suite covers host lifecycle, client SSR, rollout parsing, delta updates, sub-agent filtering, and state persistence without requiring global DSH installation.
📜 License
MIT License © 2026 Walvez.