-
Notifications
You must be signed in to change notification settings - Fork 1.2k
dsh-import-agents: 把 pi / opencode / codex / Claude Code 的历史会话导入 dsh(中英双语) #767
中文
dsh-import-agents:把 pi / opencode / codex / Claude Code 的历史会话与 agent 导入 DeepSeek Harness
大家好 👋 分享一个我做的 DSH 插件:dsh-import-agents。
如果你同时用多个 coding agent(pi、opencode、codex、Claude Code),历史对话散落在各处——这个插件把它们统一汇入 dsh:
- 会话导入:解析 pi(JSONL)、opencode(SQLite)、codex、Claude Code 的会话文件,写成真实的 dsh 会话(与 dsh JSONL 持久化后端同构),在会话列表里可浏览、可以直接续聊——模型拿到完整上下文(文本 + 推理 + 工具调用)。
- Agents → Skills:pi 的 agent / 模式提示词、opencode agent 自动变成 dsh 可发现的 skills(
~/.agents/skills),带来源元数据。 - 工作区归属:按原 cwd 归入对应工作区。
- 插件体验:斜杠命令(
/import-all、/import-opencode、/import-codex、/import-claude-code、/import-agents)、会话开始时的迁移询问、composer 工具行的一键 Sync 按钮。 - 零运行时依赖:只用 Node 内置模块(zstd、sqlite)。
0.3.0 还做了一个大优化:codex 会为每个 turn / fork 写独立 rollout 文件、子 agent 也是独立文件,旧版导入会把它们当成独立会话(真实数据上 677 个文件!)。新版按会话族谱的 root 分组——一个对话 = 一个会话(子 agent 内容合并进父会话),677 个文件收敛成 348 个对话。
安装(DSH Desktop / dsh 通用):
dsh plugin --profile web add dsh-import-agents
- 仓库:https://github.com/Chang-Tong/dsh-import-agents (MIT)
- npm:
dsh-import-agents(v0.3.0,插件市场可搜索到) - 中文文档:仓库 README.zh.md
欢迎反馈——尤其欢迎多个 coding agent 混用的朋友 😄
English
dsh-import-agents: bring pi / opencode / codex / Claude Code history & agents into DeepSeek Harness
Hi 👋 Sharing a plugin I built: dsh-import-agents.
If you work across several coding agents (pi, opencode, codex, Claude Code), your history is scattered — this plugin pulls it all into dsh:
- Session import — parses pi JSONL sessions, the opencode SQLite store, codex and Claude Code session files into real dsh sessions (same on-disk format as the dsh JSONL backend): browsable and resumable, with the full context (text, reasoning, tool calls).
- Agents → Skills — pi agents / mode prompts and opencode agents become discoverable dsh skills (
~/.agents/skills) with provenance metadata. - Workspace placement — sessions attach to the workspace matching their original cwd.
- Plugin UX — slash commands (
/import-all,/import-opencode,/import-codex,/import-claude-code,/import-agents), a session-start migration prompt, and a one-click Sync button in the composer. - Zero runtime deps — Node built-ins only (zstd, sqlite).
0.3.0 also groups codex rollout files into conversations: codex writes one rollout file per turn/fork, plus a separate file per sub-agent — the old import treated each file as its own session (677 files on real data!). The new import keeps one session per conversation (sub-agent transcripts merged into the parent): 677 files → 348 conversations.
Install (works in DSH Desktop and plain dsh):
dsh plugin --profile web add dsh-import-agents
- Repo: https://github.com/Chang-Tong/dsh-import-agents (MIT)
- npm:
dsh-import-agents(v0.3.0, searchable in the plugin market)
Feedback welcome — especially if you hop between multiple coding agents too 😄