Adds a line-based copy tool for replacing or inserting file sections, with indentation control and diff previews.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-copy-tool
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:kezan31/dsh-copy-tool
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
Give your agent human-like copy-and-paste for precise cross-file refactoring.
An enhanced line-selection copy plugin for DeepSeek Harness.
Use copy instead of write or edit to copy code between files—for example, extracting a reusable block or function, splitting a file, or inserting a section. The tool copies selected source lines into the target and does not remove them from the source.
Features
- Copy individual 1-based lines or ranges to corresponding target lines
- Replace targets with
target_lines, or insert before a target line withinsert_at - Append directly with
insert_at: "end"without placeholder lines - Use arrays such as
[[633, 889]]or[633, [640, 645], 700]forlinesandtarget_lines - Strip common indentation from non-empty source lines and add an explicit four-space
indentlevel - Preview a bounded unified diff with required
dry_run - Atomically update existing targets and create missing replacement targets
- Preserve untouched content and calculated line endings, including mixed-ending targets
- Resolve paths relative to the current session workspace and respect its sandbox policy
Install
npm (recommended)
cd $env:USERPROFILE\.dsh\profiles\web
npm install dsh-copy-tool
Then add dsh-copy-tool to the dsh.profile.bundles array in package.json, and restart DSH Web.
dsh plugin command
dsh plugin --profile web add dsh-copy-tool
If the bundle list is not updated automatically, add dsh-copy-tool to dsh.profile.bundles in the profile's package.json manually, then restart DSH Web.
Usage
The base parameters are required. Provide exactly one of target_lines and insert_at.
Replace corresponding target lines
Expanded lines and target_lines must select the same number of lines; each source line maps to the target line at the same position:
{
"source_file": "source.py",
"target_file": "module.py",
"lines": [[633, 644]],
"target_lines": [[1, 12]],
"indent": 0,
"dry_run": true
}
A line list can mix individual numbers and ranges:
{
"source_file": "source.py",
"target_file": "module.py",
"lines": [633, [640, 645], 700],
"target_lines": [1, [2, 7], 8],
"indent": 1,
"dry_run": false
}
Insert or append source lines
insert_at is a 1-based target line number and inserts before that line. Use "end" to append after the final target line:
{
"source_file": "MOD.md",
"target_file": "回复格式.md",
"lines": [[1, 254]],
"insert_at": "end",
"indent": 0,
"dry_run": true
}
Line numbers are 1-based. Source indentation common to selected non-empty lines is removed, then indent * 4 spaces are added; whitespace-only lines keep their original content. target_lines and insert_at are mutually exclusive. Insertion requires an existing target file, while a missing target is created only by replacement with continuous target_lines beginning at 1. Use dry_run: true to inspect the diff before writing, then repeat with dry_run: false after approval.
Demo and efficiency benchmark
Copy operation

1,000-line file comparison
The fixtures are plain-text files, each initially 1,000 lines. This single end-to-end run inserted source lines 451–550 (100 lines) before target line 501. Timing includes relevant reads, tool calls, and verification. The edit column is a text-only baseline, not a recommendation for moving code.
| Metric | Using copy |
Without copy (edit) |
|---|---|---|
| End-to-end time | 57.364 s | 62.382 s |
| Difference | 5.018 s faster (about 8%) | — |
| Write operation calls (excluding reads) | 2 (preview + write) | 1 (literal replacement) |
| Tool argument text | 369 characters | 5,828 characters |
| Estimated visible payload | ~7,797 characters / ~1,950 tokens | ~13,643 characters / ~3,411 tokens |
| Result | 1,100 lines | 1,100 lines; identical to copy output |

Token estimates use a rough 4-characters-per-token conversion, exclude shared system prompts/tool schemas, and are not platform-reported usage. Each method was run once; timings include model/tool interaction overhead and are not pure execution time.
License
MIT
Links
More in this category
Tencent/WeKnora#dsh-weknora★ 38526
Four read-only tools over a WeKnora knowledge base: list knowledge bases, hybrid passage search, reassemble one document's chunks in order, and WeKnora's own cited RAG or ReAct-agent answer with a resumable session id.
DayuanJiang/next-ai-draw-io#dsh-plugin★ 37266
Draws draw.io diagrams in DeepSeek Harness through the next-ai-drawio MCP server: the link in the reply opens a live preview in the right sidebar, you can edit the diagram by hand, and each AI change is a version you can restore. Node.js 18+; npx downloads the MCP server on first use.
yikart/AiToEarn#dsh-plugin-aitoearn★ 28921
Generate copy, images and short videos, and publish with one click to Douyin, Kuaishou, Xiaohongshu, WeChat Official, Bilibili, Facebook, TikTok and more, covering the full content lifecycle from creation to publishing and monetization.
superdesigndev/treg★ 9983
Tool catalog for agents: search ~2,600 external endpoints (SEO and SERP, backlinks, social, people and company enrichment, ad libraries, scraping) by the task you want done, read each one's parameters and per-call price, then call it with the credential injected server-side. Ships the skill plus an MCP row that stays disabled until TREG_TOKEN is set.
T-Auto/dsh-ops★ 6095
Provides bash, PowerShell 7, and high-performance Rust tools for DSH on Windows to reduce token usage.
Hithink-Tech-Org/Financial-API#hithink-finance★ 4745
Query Hithink Finance data in DeepSeek Harness, view charts in chat, and save refreshable dashboards.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.