← 返回
开发者工具 中文

Cursor Agent for OpenClaw

Run Cursor Agent CLI for coding tasks — writing, editing, refactoring, reviewing, or planning code — without spending OpenClaw API credits. Use when the user...
运行 Cursor Agent CLI 执行编码任务——编写、编辑、重构、审查或规划代码——无需消耗 OpenClaw API 额度。适用于用户...
albinati albinati 来源
开发者工具 clawhub v1.0.2 1 版本 99878.2 Key: 无需
★ 0
Stars
📥 820
下载
💾 13
安装
1
版本
#latest

概述

Cursor Agent

Cursor Agent CLI runs on the user's Cursor subscription — zero API cost. Always prefer it over inline code generation for any non-trivial coding task.

Prerequisites

Required binary: agent (Cursor Agent CLI)

Install from the official site: https://cursor.com/docs/cli/overview — then verify with agent --version.

The helper script (scripts/run.sh) will exit with an error if agent is not found in PATH.

User Consent Required — MANDATORY

This skill MUST NOT be invoked autonomously. Every invocation requires:

  1. State intent first — tell the user: the repo, the task, the model, and whether files will be changed
  2. Wait for explicit "yes" — do not proceed without clear user approval
  3. Default to read-only — use run.sh ask unless the user explicitly asks for changes
  4. Before writing files — run in ask mode first, show the user the plan, then ask: "Apply these changes?"
  5. Before --cloud — explicitly warn: "This will send repo contents to cursor.com. OK to proceed?"
  6. Before committing — show the diff and get confirmation

The helper script (scripts/run.sh) defaults to ask (read-only). Pass write as the mode argument only after the user has confirmed changes should be applied.

Model Routing

Task typeModel flagMode flag
---------
Trivial / exploratory(omit — auto)(omit)
Bug fix / feature / refactor--model sonnet-4.6(omit)
Code review / explain (read-only)--model sonnet-4.6--mode=ask
Architecture / design planning--model opus-4.6-thinking--mode=plan
Long background task--model sonnet-4.6use --cloud instead of -p

Headless Commands

Read-only first — always start with --mode=ask to review before applying changes:

cd <repo> && agent -p "<task>" --model sonnet-4.6 --mode=ask --output-format text --trust

Apply changes — only after user confirms the plan:

cd <repo> && agent -p "<task>" --model sonnet-4.6 --force --output-format text --trust

Cloud/background — warn user that repo data goes to cursor.com:

cd <repo> && agent -c "<task>" --model sonnet-4.6 --trust
# Monitor at: cursor.com/agents

Git Rule

Cursor sandbox blocks git commit. Always commit manually after Cursor edits:

cd <repo> && git add -A && git commit -m "<conventional commit message>" && git push

Show the diff to the user and confirm before committing if the change is large or touches sensitive areas.

Repos & Workdirs

  • Always cd to the correct repo before running
  • Check for .cursor/rules and AGENTS.md in the repo root — Cursor loads these automatically for project context

Context & Sessions

  • Add @ in prompt to include specific files in context
  • --continue or --resume to continue a previous session
  • agent ls to list previous sessions

Output Handling

  • --output-format text → clean final answer, summarise key changes to the user
  • --output-format json → structured, use for scripted parsing
  • Always report back: what changed, what was committed, any issues found

References

  • Model list & details: references/models.md
  • Slash commands (interactive mode): references/slash-commands.md

版本历史

共 1 个版本

  • v1.0.2 当前
    2026-03-31 15:55 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 676 📥 325,610
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 71 📥 181,372
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,373