DeepSeek Harness 插件

qyjqio/dsh-cursor-toolkit#cursor-cli

Star 数 ★ 0 分类 工具与能力 收录于 2026-10-22

把编码任务交给本机 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 the executable config 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_KEY is honored.
  • Timeout: the tool kills the CLI with SIGTERM, then SIGKILL after 3 s.
  • cwd is validated before spawning; a missing directory fails fast instead of letting Cursor create one.

内容来自项目 README(GitHub)↗

链接

同类插件

查看整个分类 →

社区评论

评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。