返回顶部
c

cursor-cloud-agentsCursor云代理

Deploy Cursor AI agents to GitHub repos. Automatically write code, generate tests, create documentation, and open PRs using your existing Cursor subscription.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.3.3
安全检测
已通过
1,100
下载量
免费
免费
2
收藏
概述
安装方式
版本历史

cursor-cloud-agents

Cursor Cloud Agents 技能

⚡ 快速参考

最常用的命令和模式:

bash

启动一个代理(使用默认模型:gpt-5.2)


cursor-api.sh launch --repo owner/repo --prompt 为认证模块添加测试

检查代理状态

cursor-api.sh status

获取对话历史

cursor-api.sh conversation

发送后续消息

cursor-api.sh followup --prompt 同时添加边界情况测试

列出所有代理

cursor-api.sh list

检查使用量/配额

cursor-api.sh usage

常用选项:

  • - --model - 指定模型(默认:gpt-5.2)
  • --branch - 目标分支
  • --no-pr - 不自动创建PR
  • --no-cache - 绕过缓存
  • --verbose - 调试输出
  • --background - 在后台模式下运行代理

后台任务:
bash
cursor-api.sh launch --repo owner/repo --prompt ... --background
cursor-api.sh bg-list
cursor-api.sh bg-status
cursor-api.sh bg-logs

最大运行时间(后台任务):
bash

默认为24小时


cursor-api.sh launch --repo owner/repo --prompt ... --background

自定义最大运行时间(2小时)

cursor-api.sh launch --repo owner/repo --prompt ... --background --max-runtime 7200

无限制运行时间(不推荐)

cursor-api.sh launch --repo owner/repo --prompt ... --background --max-runtime 0

通过环境变量设置默认值

export CURSORBGMAX_RUNTIME=43200 # 12小时 cursor-api.sh launch --repo owner/repo --prompt ... --background

短命令(cca 别名):

为了更快的日常使用,加载 cca-aliases.sh 文件:
bash
source scripts/cca-aliases.sh

然后使用 cca 代替 cursor-api.sh:
bash
cca list # 列出代理
cca launch --repo ... # 启动代理
cca status # 检查状态
cca conversation # 获取对话
cca followup --prompt # 发送后续消息
cca delete # 删除代理

退出码: 0=成功, 1=API错误, 2=认证, 3=速率限制, 4=仓库访问, 5=无效参数



概述

本技能封装了 Cursor Cloud Agents HTTP API,允许 OpenClaw 将编码任务分派给 Cursor 的云代理,监控其进度,并整合结果。

使用时机

在以下情况下使用本技能:

  • - 将编码任务委托给在 GitHub 仓库上运行的 Cursor 代理
  • 在现有代码库上生成代码、测试或文档
  • 异步执行重构或功能实现
  • 获取代码更改的第二意见

不适用场景

  • - 不需要代码更改的简单问题
  • 需要实时流式响应(请使用本地 Cursor CLI)
  • GitHub 仓库之外的任务

认证

本技能按以下顺序自动发现您的 Cursor API 密钥:

  1. 1. 环境变量: CURSORAPIKEY
  2. OpenClaw 环境文件: ~/.openclaw/.env
  3. OpenClaw 本地环境: ~/.openclaw/.env.local
  4. 项目环境: 当前目录中的 .env
  5. Cursor 配置: ~/.cursor/config.json

推荐: 添加到 ~/.openclaw/.env:
bash
CURSORAPIKEY=yourcursorapikeyhere

获取您的 API 密钥:

  1. 1. 打开 Cursor IDE
  2. 转到设置 → 通用
  3. 复制您的 API 密钥

验证是否正常工作:
bash
cursor-api.sh me

工作流模式

模式 A:即发即忘

启动一个代理并让其独立工作。稍后检查结果。

bash

启动代理(使用默认模型:gpt-5.2)


cursor-api.sh launch --repo owner/repo --prompt 为认证模块添加全面测试

使用特定模型启动

cursor-api.sh launch --repo owner/repo --prompt 添加测试 --model claude-4-opus

响应:{id: agent_123, status: CREATING, ...}

稍后 - 检查状态

cursor-api.sh status agent_123

注意: 如果未指定 --model,将自动使用默认模型(gpt-5.2)。您会看到一条消息指示正在使用的模型。

最适合: 不需要立即关注的任务、探索性工作

模式 B:监督式分派

启动、监控,并在完成时报告结果。

bash

1. 启动


cursor-api.sh launch --repo owner/repo --prompt 实现用户认证

2. 轮询完成状态(每60秒检查一次)

while true; do status=$(cursor-api.sh status agent_123) if [[ $(echo $status | jq -r .status) == FINISHED ]]; then break fi sleep 60 done

3. 获取结果

cursor-api.sh conversation agent_123 | jq -r .messages[] | select(.role == assistant) | .content

最适合: 需要报告完成状态的重要任务

模式 C:迭代协作

启动、审查并发送后续消息以完善工作。

bash

1. 启动初始任务


cursor-api.sh launch --repo owner/repo --prompt 添加登录页面

2. 审查对话

cursor-api.sh conversation agent_123

3. 发送后续消息

cursor-api.sh followup agent_123 --prompt 同时添加表单验证和错误处理

4. 完成时最终审查

cursor-api.sh conversation agent_123

最适合: 需要多次迭代的复杂任务

模式 D:后台模式

对于长时间运行的任务,在后台模式下启动代理并稍后检查。

bash

在后台启动


result=$(cursor-api.sh launch --repo owner/repo --prompt 重构整个代码库 --background)
taskid=$(echo $result | jq -r .backgroundtask_id)
echo 任务已启动:$task_id

列出活动后台任务

cursor-api.sh bg-list

检查特定任务状态

cursor-api.sh bg-status $task_id

查看日志

cursor-api.sh bg-logs $task_id

列出所有任务,包括已完成的任务

cursor-api.sh bg-list --all

后台任务会自动监控,日志保存到 ~/.cache/cursor-api/background-tasks/。

最适合: 长时间运行的任务(10分钟以上)、批量操作、CI/CD集成

命令参考

列出代理

bash
cursor-api.sh list

返回所有代理及其状态、仓库和创建时间。

启动代理

bash
cursor-api.sh launch --repo owner/repo --prompt 您的任务描述 [--model model-name] [--branch branch-name] [--no-pr] [--background]

选项:

  • - --repo(必需):owner/repo 格式的仓库
  • --prompt(必需):代理的初始指令
  • --model(可选):使用的模型(未指定时默认为 gpt-5.2)
  • --branch(可选):目标分支名称(省略时自动生成)
  • --no-pr(可选):不自动创建PR
  • --background(可选):在后台模式下运行代理

注意: 当未使用 --model 启动时,技能自动使用 gpt-5.2 并显示一条消息指示正在使用的模型。

后台模式: 使用 --background 时,命令立即返回一个 backgroundtaskid。使用 bg-list、bg-status 和 bg-logs 监控进度。

检查状态

bash
cursor-api.sh status

返回:

  • - status:CREATING、RUNNING、FINISHED、STOPPED、ERROR
  • summary:已完成工作的摘要(如果完成)
  • prUrl:创建的PR的URL(如果有)

获取对话

bash
cursor-api.sh conversation

返回完整的消息历史,包括所有提示和响应。

发送后续消息

bash
cursor-api.sh followup --prompt 附加指令

用新的指令恢复已停止或已完成的代理。

停止代理

bash
cursor-api.sh stop

优雅地停止正在运行的代理。

###

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 cursor-cloud-agents-1776419992 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 cursor-cloud-agents-1776419992 技能

通过命令行安装

skillhub install cursor-cloud-agents-1776419992

下载

⬇ 下载 cursor-cloud-agents v1.3.3(免费)

文件大小: 29.4 KB | 发布时间: 2026-4-17 19:32

v1.3.3 最新 2026-4-17 19:32
Add security scanning notes and clarifying comments for base64 auth pattern

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部