← 返回
数据分析 中文

Cursor Tui

Spawn and relay Cursor Agent's CLI (`agent` binary) as an interactive passthrough. Use when the user wants to run Cursor Agent in a directory, ask it questio...
生成并透传 Cursor Agent 的 CLI(`agent`),实现交互式运行。适用于用户在目录中运行 Cursor Agent 并提问的场景。
waldyrious
数据分析 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 1
Stars
📥 1,090
下载
💾 19
安装
1
版本
#latest

概述

Cursor CLI Passthrough

Spawn Cursor's agent in a PTY background session and relay its output and the user's inputs as a silent passthrough.

Spawning

{ "tool": "exec", "command": "agent", "pty": true, "background": true, "workdir": "<project-dir>", "yieldMs": 3000 }
  • Always set workdir to the project directory the user wants to work in (not the OpenClaw workspace).
  • If the user doesn't specify a directory, ask before spawning.
  • Note: agent requires workspace trust on first run in a directory — relay the trust prompt and send the user's choice (e.g. a, w, or q) via process send-keys.

Relaying output

After spawning or sending input, poll for output:

{ "tool": "process", "action": "poll", "sessionId": "<id>", "timeout": 15000 }
  • Strip ANSI escape codes mentally, but relay the content faithfully and verbatim.
  • Do not wrap output in code blocks or quote formatting.
  • Do not add preamble, postamble, interpretation, or commentary — relay exactly what Cursor outputs.
  • If you need to add context or a note, prefix that line with your name in brackets (e.g. [YourName]) so it's clearly distinguished from Cursor's output.
  • Permission prompts: When Cursor shows a "Run this command?" or any approval dialog, relay it verbatim to the user and wait for their response. Never approve or deny on the user's behalf.
  • After relaying the agent's response, append a single prompt line: cursor @ — use ~ in place of the user's home directory (e.g. ~/repos/myproject not /home/username/repos/myproject).

Sending user input

For single-line prompts:

{ "tool": "process", "action": "submit", "sessionId": "<id>", "data": "<text>" }

For multi-line prompts:

{ "tool": "process", "action": "paste", "sessionId": "<id>", "text": "<text>" }

Then submit with Enter:

{ "tool": "process", "action": "send-keys", "sessionId": "<id>", "keys": ["Enter"] }

For other special keys (arrow keys, Escape, etc.):

{ "tool": "process", "action": "send-keys", "sessionId": "<id>", "keys": ["ArrowUp"] }

Use @filename or @directory/ in interactive prompts to add more context.

Ending the session

Send /quit or Ctrl+D (double-press):

{ "tool": "process", "action": "submit", "sessionId": "<id>", "data": "/quit" }

Notes

  • agent is Cursor's CLI binary. cursor-agent is a backward-compatible alias.
  • The binary must be on PATH. If not found, check TOOLS.md for custom binary paths.
  • One session at a time is typical; use process list to check for orphaned sessions.

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-29 06:22 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 198 📥 65,156
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 368 📥 140,565
data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 165 📥 60,076