惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
Martin Fowler
Martin Fowler
N
Netflix TechBlog - Medium
WordPress大学
WordPress大学
罗磊的独立博客
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
Docker
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ
J
Java Code Geeks
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
美团技术团队
小众软件
小众软件
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog

Cursor

分享一个省 Cursor 额度的思路: Agent 只做调度,写代码的活儿丢给 Codex CLI 有因为 Cursor 同时注册多个账号被封的情况吗? Fable5 能无限用吗? Cursor 订阅巨坑 Cursor 3.9 版本,大陆地区无法使用高级模型的解决方案探讨 cursor 是不能用 fable 吗,这个是什么意思 Cursor 的老会员账号的含金量还在上升, Fable 5 超高每次只消耗一次请求 cursor 更新后,似乎很多高级大模型都不能用了? 某鱼/某宝上的 cursor 年付特惠靠谱吗 cursor 好像必须要开全局代理了,否则看不到 GPT、Claude 模型了:( cursor 一个月一次,没有重置,是不是有点点贵啊 cursor 的开发效率不行啊 什么样的 cursor pro 号可以无限用 cursor 输出的内容消失是咋回事 cursor 是不是挂了啊,总是提示失败 。 Cursor 不能用 Claude 模型了? Cursor 开源替代推荐 SpaceX 已行使选择权,通过全股票交易收购 cursor SpaceX 将以 600 亿美元全股票收购 Cursor cursor 50% off 券 Cursor 比微软还财大气粗啊。。 关于某鱼上那些卖 cursor pro 独享额度的 Cursor 支付宝支付不能用了吗? cursor 乱扣款怎么退款? Cursor 20 刀套餐如果只用 auto 会不会比 GPT plus 更耐用? cursor 老计划又不能嫖 max mode 模型了 Cursor 给在校大学生免费赠送一年 Pro 会员 用 cursor 的不要再用 HTTP/1.0 或者 HTTP/1.1 协议了 cursor 已死 通过 Cursor 邀请计划,新用户可获得 Pro、Pro+ 或 Ultra 半价优惠
[分享] Opencli 用 CDP 协议从终端直控 Cursor IDE
tohearts · 2026-04-24 · via Cursor

发 Prompt 、切模型、翻历史、截图,11 条命令搞定

做了个 opencli 插件,通过 Chrome DevTools Protocol 直接操控 Cursor IDE 。不是调 CLI ,是真的在操控 IDE 的 UI——你在终端发的 prompt ,打开 Cursor 对话还在。

GitHub: https://github.com/toheart/cursor-agent

解决什么问题

Cursor 3 出了独立 Agent 窗口之后,我日常需要:

  • 在终端脚本里让 Cursor 跑任务,不想每次切窗口
  • 远程(手机/平板)给 Cursor 发 prompt ,回来打开 IDE 会话还在
  • 批量操作:切项目 → 切模型 → 发任务 → 截图存档,一套脚本搞定

之前用 Cursor CLI 方案,四个问题一直没解决:上下文断裂( CLI 和 IDE 是两个会话)、展示效果差、粒度粗、配置麻烦。

原理

Cursor 是 Electron 应用 → 底层是 Chromium → 支持 CDP ( Chrome DevTools Protocol )。

启动时加个参数:

Cursor.exe --remote-debugging-port=9226

然后通过 WebSocket 连上去,就能 Runtime.evaluate 执行 JS 、Input.insertText 输入文本、Input.dispatchMouseEvent 模拟点击、Page.captureScreenshot 截图。

本质上就是把 F12 开发者工具能干的事,封装成了终端命令。

11 条命令

opencli cursor status          # 检查 CDP 连接
opencli cursor list            # 列出所有窗口(自动识别 Agent/Editor )
opencli cursor send "prompt"   # 发 Prompt 并等待 AI 回复
opencli cursor read            # 读取当前对话内容
opencli cursor model           # 列出可用模型
opencli cursor model-switch "sonnet"  # 模糊匹配切模型
opencli cursor history         # 翻历史会话
opencli cursor screenshot      # 截图保存 PNG
opencli cursor new-chat        # 新建对话
opencli cursor project         # 列出项目( Agent 窗口)
opencli cursor project-switch "my-app" # 切项目

所有命令自动适配 Cursor 3 的 Agent 独立窗口和传统 Editor 嵌入式聊天面板,不需要手动指定窗口类型。

实际效果

列出窗口:

┌─────┬────────┬──────────────────────────────────────┐
│ Idx │ Type   │ Title                                │
├─────┼────────┼──────────────────────────────────────┤
│ 1   │ Editor │ blog-openclaw-soul.md - cursor-agent │
│ 2   │ Agent  │ Cursor Agents                        │
│ 3   │ Editor │ SKILL.md - ai-pipeline               │
└─────┴────────┴──────────────────────────────────────┘

切模型:

┌─────┬────────────┬────────┬─────────┐
│ Idx │ Name       │ Tier   │ Current │
├─────┼────────────┼────────┼─────────┤
│ 1   │ Composer 2 │ Fast   │         │
│ 2   │ Sonnet 4.6 │ Medium │         │
│ 3   │ Opus 4.6   │ High   │ ✓       │
└─────┴────────────┴────────┴─────────┘

和 CLI 方案的本质区别

CLI 方案的会话活在 CLI 进程里——退了就没了。

CDP 方案的会话活在 IDE 里——你从终端、从脚本、从远程触发的每一条 prompt ,都真实存在于 Cursor IDE 的对话历史中。回到电脑前打开 Cursor ,刚才的对话就在那里,直接接着聊。

安装

# 一行安装,零依赖( esbuild 内联打包,不需要 npm install )
opencli plugin install github:toheart/cursor-agent/cursor-cdp

# 确认连接
opencli cursor status

前提:Cursor 需要带 --remote-debugging-port=9226 参数启动(在快捷方式里加就行,需要先关闭所有 Cursor 窗口再重启)。

自动化示例

#!/bin/bash
opencli cursor project-switch "my-backend"
opencli cursor new-chat
opencli cursor model-switch "opus"
opencli cursor send "分析 src/auth 模块有没有安全隐患"
opencli cursor screenshot --output report.png

五行脚本,完整的自动化编程流程。


项目开源,基于 opencli 插件体系: https://github.com/toheart/cursor-agent

有问题楼下聊,欢迎 Star 。