Chang-Tong/dsh-import-agents ↗★ 7
dsh-import-agents
将 pi、opencode、codex 和 claude-code 的会话、聊天历史及 Agent 导入至 DeepSeek Harness 的插件,支持斜杠命令、迁移提示和一键同步。
AI 分析
核心用途是跨平台迁移 Agent 会话和技能。适合此前使用过 pi 或 Claude Code 等工具,并希望将历史记录无缝同步到 DSH 的用户。
安裝
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Chang-Tong/dsh-import-agents說明文件
閱讀完整 README ↗Usage
Quick start
- Refresh the page after a restart.
- Click Sync in the composer tool row — or type
/import-allin the input. - Imported sessions appear in the session list (grouped by workspace); imported agents appear as skills.
Everything is idempotent — run it as often as you like; already-imported sessions are skipped.
Slash commands
| Command | What it does |
|---|---|
/import-pi [options] | Import pi sessions |
/import-opencode [options] | Import opencode sessions |
/import-codex [options] | Import codex sessions |
/import-claude-code [options] | Import claude-code sessions |
/import-agents | Convert pi/opencode agents & prompts into dsh skills |
/import-all [options] | All of the above (4 sources + agents) |
/attach-workspaces | Attach imported sessions to cwd-matched workspaces (retro-fit) |
Options: --limit N · --project · --since · --no-tools · --tools-as-text · --tool-truncate N
CLI (no dsh needed)
node import.mjs all # dry-run preview (writes nothing)
node import.mjs all --apply # write sessions + skills
node import.mjs sessions codex --apply --limit 20 # one source at a time
node import.mjs agents --apply # agents/prompts → skills only
node export.mjs # export sessions as Markdown for any agent to read
import.mjsdefaults to dry-run; pass--applyto write.all= pi + opencode + agents; add codex/claude-code explicitly (e.g.sessions codex,sessions claude-code).export.mjswrites$DSH_HOME/exports/ /.md(--source,--project,--limit,--since,--out,--no-reasoning,--no-tools).
Configuration
| Key | Default | Meaning |
|---|---|---|
offerOnStart | true | Ask about migration when a new top-level session starts |
piRoot | ~/.pi/agent/sessions | pi session root |
piAgentRoot | ~/.pi/agent | pi agents & prompts root |
opencodeDb | ~/.local/share/opencode/opencode.db | opencode SQLite path |
opencodeConfig | ~/.config/opencode | opencode agents root |
codexRoot | ~/.codex/sessions | codex session root |
claudeRoot | ~/.claude/projects | claude-code projects root |
skillsRoot | $DSH_AGENTS_HOME/skills | skills output root |
toolTruncate | 1000 | tool-call arguments truncation (chars) |
The migration prompt only fires for brand-new top-level sessions (startup, not subagents) that have a cwd and unimported history. Per-project decisions and the global agents decision are stored in $DSH_HOME/import-pi-opencode-state.json; headless environments without a UI provider silently skip the prompt.