Chang-Tong/dsh-unified-context ↗★ 21
dsh-unified-context
DSH Unified Context (统一上下文): migrate pi/opencode/codex/claude-code/WorkBuddy sessions into DeepSeek Harness, share AGENTS.md/skills/project & agent memory through symlinks, and migrate automations. One context, every harness.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add dsh-unified-context说明文档
阅读完整 README ↗Usage
Quick start
- Refresh the page after a restart.
- Click Sync in the composer tool row — or type
/import-allin the input. This runs the complete migration: sessions from all five sources, agents → skills, shared context links, and paused automation tasks. - Imported sessions appear in the session list (grouped by workspace); imported agents appear as skills; the Automation tasks page shows the migrated tasks (paused — pause the source automation first, then resume it in dsh).
Everything is idempotent — run it as often as you like; already-imported sessions are skipped, existing links are reused, and identical automation tasks are not duplicated.
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-workbuddy [options] | Import WorkBuddy sessions |
/import-agents | Convert pi/opencode agents & prompts into dsh skills |
/link-context [--project DIR] [--dry-run] [--push] [--memory=authority|merge|off] [--authority=harness] | Share one AGENTS.md/CLAUDE.md/CODEBUDDY.md, skill hub and long-term memory across harnesses with symlinks (never copies) |
/import-automations [--only id] [--activate] [--dry-run] | Migrate Codex + WorkBuddy automations into dsh scheduled tasks (paused by default) |
/import-all [options] | All of the above (5 session sources + agents + context links + paused automations) |
/attach-workspaces | Attach imported sessions to cwd-matched workspaces (retro-fit) |
Options: --limit N · --project · --since · --no-tools · --tools-as-text · --tool-truncate N · --context-project DIR · --push · --activate
CLI (no dsh needed)
node import.mjs all # dry-run preview (writes nothing)
node import.mjs all --apply # sessions + skills + shared context links
node import.mjs sessions codex --apply --limit 20 # one source at a time
node import.mjs sessions workbuddy --apply # WorkBuddy sessions
node import.mjs agents --apply # agents/prompts → skills only
node import.mjs context --apply # share AGENTS.md/CLAUDE.md/CODEBUDDY.md + skills
node import.mjs context --push --apply # also link hub skills into every harness root
node import.mjs context --project-dir ~/work/app --apply # project-level unification
node import.mjs context --memory=merge --apply # merged memory index (references, no copies)
node import.mjs context --authority=workbuddy --apply # pick which harness memory wins
node import.mjs automations # plan Codex/WorkBuddy automations (paused)
node export.mjs # export sessions as Markdown for any agent to read
import.mjsdefaults to dry-run; pass--applyto write.all= five session sources + agents + context links (with--apply) + the automation plan. Creating automation tasks needs the running host — use/import-automationsin dsh.contextlinks one shared copy instead of copying: no-op on re-runs, conflicts are reported and left untouched;--pushopts into bidirectional skill parity.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 |
workbuddyRoot | ~/.workbuddy | WorkBuddy data root (sessions, skills) |
workbuddyAutomationsDb | ~/Library/Application Support/WorkBuddy/automations/automations.db | WorkBuddy automations SQLite database |
codexHome | ~/.codex | Codex config root (automations/ is read from here) |
timeZone | Asia/Shanghai | time zone used when translating automation RRULEs |
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/unified-context-state.json; headless environments without a UI provider silently skip the prompt.