把编码任务交给本机 Cursor CLI 代理在工作目录中执行,并可按 chat id 续跑。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:qyjqio/dsh-cursor-toolkit#path:/packages/dsh-cursor-cli
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
DSH host plugin that adds the cursor_agent tool: run the Cursor CLI
(cursor-agent) headlessly on a task in a workspace, straight from any DSH
agent session.
Cursor runs its own agent loop (reads/edits files, calls tools) and the tool
returns its final message plus the Cursor chat id, so a run can be continued
later with resume.
Install
# from a DSH session with the plugin manager available — git source, pinned by the market index
plugin_manager install_bundle target="git+https://github.com/qyjqio/dsh-cursor-toolkit.git#<commit>&path:/packages/dsh-cursor-cli"
# or plain pnpm, inside a DSH profile directory
pnpm add "git+https://github.com/qyjqio/dsh-cursor-toolkit.git#<commit>&path:/packages/dsh-cursor-cli"
Then enable the bundle (include:cursor-cli) in Settings → Plugins, or add
@qyjqio/dsh-cursor-cli to the profile's dsh.profile.bundles.
Requirements
- Cursor CLI installed and logged in:
cursor-agent --version,cursor-agent login. - The executable is resolved from, in order:
PATH,~/.local/bin,/usr/local/bin,/usr/bin(override with theexecutableconfig field). - Headless runs need the workspace trusted, so the tool always passes
--trust.
Parameters
| name | type | meaning |
|---|---|---|
prompt |
string (required) | Task for Cursor; be explicit about goal and done criteria |
cwd |
string | Workspace dir; defaults to the session working directory, accepts ~ |
mode |
agent | plan | ask |
agent edits/runs tools; plan/ask are read-only |
model |
string | Cursor model id (e.g. auto, composer-2.5); default = CLI default |
force |
boolean | Pass --force (auto-approve tool calls). Default true; ignored for read-only modes |
resume |
string | Cursor chat id returned by a previous run |
continueSession |
boolean | Continue the most recent chat in the workspace |
timeoutSeconds |
integer 1..3600 | Run budget; default 900 |
Result
{ ok, result, cwd, mode, truncated, timedOut, aborted,
sessionId?, model?, durationMs?, exitCode?, stderr? }
ok is false when the process exits non-zero, Cursor reports is_error, or the
run times out / is aborted. The rendered card shows the final message plus a
footer with session id, model, mode, duration and cwd.
Config
Optional bundle config (all values are defaults in code when omitted):
| key | default | meaning |
|---|---|---|
executable |
auto-detected | Path to cursor-agent |
allowForce |
true |
Whether force may be passed at all |
model |
CLI default | Default model when the call omits one |
maxOutputChars |
60000 |
Result truncation limit |
timeoutMs |
900000 |
Default timeout |
Examples
cursor_agent({ prompt: "Fix the failing test in tests/auth.spec.ts" })cursor_agent({ prompt: "Review src/api for error handling gaps", mode: "plan" })cursor_agent({ prompt: "Now apply the plan", resume: "<sessionId>" })
Notes
- Tools run with the host process environment, so
CURSOR_API_KEYis honored. - Timeout: the tool kills the CLI with SIGTERM, then SIGKILL after 3 s.
cwdis validated before spawning; a missing directory fails fast instead of letting Cursor create one.
链接
同类插件
Tencent/WeKnora#dsh-weknora★ 35014
把 WeKnora 知识库接入 dsh 的四个只读工具:列出知识库、混合检索原文片段、按顺序还原单篇文档,以及直接取用 WeKnora 自己带引用的 RAG 或 ReAct agent 回答(含可续聊的 session id)。
superdesigndev/treg★ 5944
给 Agent 的工具目录:按「要做的事」检索约 2,600 个外部接口(SEO 与 SERP、外链、社交、人物与公司信息补全、广告库、抓取),查看参数与单次调用价格后直接调用,凭据由服务端注入。附带技能,MCP 行在未设置 TREG_TOKEN 前保持禁用。
T-Auto/dsh-ops★ 3709
为 Windows 的 DSH 提供 bash、PowerShell 7 及 Rust 高性能工具,减少 token 消耗。
TencentCloudBase/CloudBase-AI-Toolkit#dsh-plugin★ 1141
把腾讯云 CloudBase 后端接入 DeepSeek Harness——在对话里搭好并部署全栈应用,查询结果渲染为表格卡片(分页、排序、导出 CSV),部署后可预览真实域名,并提供 CloudBase MCP 工具集(`mcp__cloudbase__*`),登录走 device-code 流程。
sixtysevenlf/dsh-blender-plugin★ 1019
让 DSH agent 通过直连 TCP 通道驱动本地 Blender,提供 16 个工具:视口帧、自定义视角渲染、Python 执行、无头与作业卸载、事务回滚,以及 28 个 family / 186 个 op 的规划层。
anysearch-team/anysearch-dsh★ 634
基于 AnySearch 的实时网页与垂直搜索插件,为 DeepSeek Harness 提供搜索工具。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。