Token导航 LogoToken导航TokenDH.com
开发敏感数据clawhub未标认证来源可访问clear审计提醒

use-cursorUSE Cursor 命令行

Agent Skill

use-cursor 用于辅助安全审计、权限检查和凭据风险排查,适合在 OpenClaw 中需要复核安全边界、认证流程或敏感配置时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,540

周安装

149

GitHub Stars

公开资料未说明

下载量

1,240
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:use-cursor(USE Cursor 命令行)
来源仓库:https://github.com/brucezhu888/use-cursor
安装命令:
openclaw skills install use-cursor
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install use-cursor

简介

通过 tmux 安全地管理 Cursor CLI 任务,强化终端操作边界。

  • 适用于代码审查、任务编排或开发环境隔离的安全审计场景。
  • 集成于 OpenClaw,支持会话持久化与权限最小化原则实施。
  • 涉及命令执行与进程管理,部署前应严格限制运行环境与输入校验。
  • use-cursor 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
use-cursor
version
1.0.4
description
Manage Cursor CLI tasks via tmux with security hardening
author
Bruce + 凤雏
license
MIT
source
https://github.com/openclaw/skills/tree/main/use-cursor
homepage
https://github.com/openclaw/skills
repository
https://github.com/openclaw/skills/tree/main/use-cursor
required
binaries
env
clawhub
security
autonomous
false
always
false
userInvocable
true

Use Cursor - OpenClaw + Cursor CLI Integration

Enable OpenClaw to execute Cursor CLI for various software engineering tasks, supporting interactive mode, background tasks, CI/CD, and more.


🔒 Security Notes

Before installing, understand these security implications:

What This Skill Does

  • ✅ Manages Cursor CLI tasks via tmux (stated purpose)
  • ✅ Reads ~/.cursor/cli-config.json to check auth status (email redacted in output)
  • ✅ Captures tmux pane output (may contain workspace code/data)
  • ✅ All shell arguments are escaped to prevent injection
  • ✅ Does not download remote code at install time

Privacy Considerations

Data AccessPurposeProtection
~/.cursor/cli-config.jsonCheck auth statusEmail redacted (shows ***@domain.com)
~/.cursor/credentialsCheck auth statusNot read, only existence checked
$CURSOR_API_KEYOptional authNot logged or stored
$PATH, $HOME, etc.Inherited by child processesNot modified or logged
tmux outputReturn task resultsMay contain workspace data

⚠️ Critical: tmux Pane Execution Risk

This skill sends user-provided strings into tmux panes via tmux send-keys.

How it works:

  1. Script creates tmux session
  2. Runs agent --print --trust 'TASK' in the pane
  3. Captures pane output and returns to agent

Risk: If the pane is running a shell, any text sent via send-keys will be executed. While we escape arguments at the JavaScript level, special characters/control sequences could still affect the shell.

Mitigation:

  • Use in isolated environments (container/VM) for untrusted tasks
  • Don't run on production machines with live secrets
  • Review task strings before sending

Recommendations

EnvironmentRecommendation
Personal dev machine✅ Safe for normal projects
Open source work✅ Safe
Corporate environment⚠️ Review with security team first
Production server❌ Not recommended
Machine with high-value secrets❌ Use isolated container/VM

Security Features (v1.0.0+)

  • ✓ Shell argument escaping via single-quote method (prevents injection)
  • ✓ tmux literal mode (-l flag) for all send-keys commands
  • ✓ Email redaction (***@domain.com)
  • ✓ API key/token redaction in output
  • ✓ No autonomous execution (always: false)
  • ✓ No remote code download
  • ✓ Explicit permissions declared in manifest
  • ✓ Isolated mode with minimal environment (hardcoded PATH)

🎯 Use Cases

ScenarioRecommended ModeDescription
Quick tasksInteractiveDirect agent "task description"
Long-running codingBackgroundtmux-managed, no timeout
CI/CD automationNon-interactiveagent -p + JSON output
Code reviewInteractive/BackgroundWith context analysis
Large refactoringBackgroundInterruptible, resumable

📦 Installation

1. Install Cursor CLI

⚠️ Security Note: The following install commands use remote scripts. Review them first or use your package manager when possible.

macOS:

# Recommended: use Homebrew (review formula first)
brew install --cask cursor-cli

# Alternative: official installer (review at https://cursor.com/install)
# curl https://cursor.com/install -fsS | bash

Linux/WSL:

# Download and inspect the installer first
curl -fsS https://cursor.com/install -o cursor-install.sh
less cursor-install.sh  # Review before running
bash cursor-install.sh

# Or check if available via your package manager

Verify installation:

agent --version
# or
cursor-agent --version

Required Dependencies:

  • tmux - Terminal multiplexer (required for background tasks)
  • agent or cursor-agent - Cursor CLI (required)
  • CURSOR_API_KEY - Optional, or use agent login for browser auth

2. Authentication

agent login
# or set API key
export CURSOR_API_KEY=your_api_key_here

3. Install tmux (Required for background tasks)

# Ubuntu/Debian
sudo apt install tmux

# macOS
brew install tmux

# CentOS/RHEL
sudo yum install tmux

🛠️ OpenClaw Tools

Tool List

ToolDescriptionExample
use_cursor_spawnStart background Cursor task (standard mode)use_cursor_spawn "refactor this module"
use_cursor_spawn_isolatedStart task with minimal environmentuse_cursor_spawn_isolated "task"
use_cursor_checkCheck task statususe_cursor_check session-name
use_cursor_sendSend additional instructionsuse_cursor_send session-name "make it async"
use_cursor_killEnd taskuse_cursor_kill session-name
use_cursor_listList all tasksuse_cursor_list
use_cursor_doctorDiagnose environmentuse_cursor_doctor

Execution Modes

ModeScriptUse Case
Standardspawn.shNormal development, trusted tasks
Isolatedspawn-isolated.shUntrusted inputs, shared machines
ContainerDocker/PodmanMaximum isolation (manual setup)

🚀 Usage

Method 1: Background Task Mode (Recommended for large jobs)

User: Help me refactor this module using Cursor in background
→ Call: use_cursor_spawn "refactor src/ directory for better performance"
→ Returns: Task ID + tmux session name

Follow-up operations:

User: Check the progress of that task
→ Call: use_cursor_check <session-name>

User: Tell that task: change to TypeScript
→ Call: use_cursor_send <session-name> "implement in TypeScript"

User: Stop that Cursor task
→ Call: use_cursor_kill <session-name>

Method 2: Direct Run Mode (Small tasks)

User: Write a unit test for me
→ Call: use_cursor_run "write unit tests for src/utils.ts"
→ Wait for completion, return result

Method 3: Interactive Mode (Local debugging)

# Start interactive session
agent

# Or with task directly
agent "fix this bug"

# Switch model
/models

# Add context
@src/api/
@src/models/

📋 Cursor CLI Command Reference

Basic Commands

CommandDescription
agentStart interactive session
agent "task"Execute task directly
agent -p "task"Print mode (for scripts)
agent --model <name>Specify model
agent --resume="<id>"Resume session
agent lsList sessions
agent resumeResume most recent session
agent modelsList available models
agent updateUpdate CLI

Slash Commands (Interactive Mode)

CommandDescription
/modelsSwitch models
/compressCompress session history
/rulesManage rules
/commandsManage custom commands
/mcp enable <server>Enable MCP server
/mcp disable <server>Disable MCP server

Keyboard Shortcuts

ShortcutDescription
Shift+EnterNew line
Ctrl+DExit (requires double-press)
Ctrl+RReview changes
↑/↓History messages

🔧 Background Task Architecture

User (Discord/Feishu) 
  → OpenClaw Agent 
  → use_cursor_spawn tool 
  → tmux session 
  → Cursor CLI Agent

tmux Session Management

# Create session
tmux new-session -d -s cursor-task-001

# Send command
tmux send-keys -t cursor-task-001 "agent 'task description'" Enter

# Capture output
tmux capture-pane -t cursor-task-001 -p -S -100

# End session
tmux kill-session -t cursor-task-001

📊 Workflows

Code Review

agent -p 'Review the changes in the current branch against main. Focus on security and performance.'

Refactoring

agent -p 'Refactor src/utils.ts to reduce complexity and improve type safety.'

Debugging

agent -p 'Analyze the following error log and suggest a fix: [paste log here]'

Git Integration

agent -p 'Generate a commit message for the staged changes adhering to conventional commits.'

CI/CD

# Security audit (JSON output)
agent -p 'Audit this codebase for security vulnerabilities' --output-format json --force

# Test coverage
agent -p 'Run tests and generate coverage report' --output-format text

⚠️ Notes

TTY Issues

❌ These will hang:

agent "task"                    # No TTY
agent -p "task"                 # No TTY  
subprocess.run(["agent", ...])  # No TTY

✅ Correct approach:

# Use tmux for pseudo-terminal
tmux new-session -d -s cursor
tmux send-keys -t cursor "agent 'task'" Enter

Timeout Protection

  • Small tasks (<5 min): Use use_cursor_run directly
  • Medium tasks (5-30 min): Background mode + periodic checks
  • Large tasks (>30 min): Background mode +分段 execution

Resource Management

  • Each tmux session uses ~50-100MB memory
  • Recommend max 3-5 concurrent background tasks
  • Use use_cursor_kill to clean up completed tasks

🏥 Troubleshooting

use_cursor_doctor Checklist

  1. ✅ tmux installed
  2. ✅ agent CLI executable
  3. ✅ Authentication status (CURSOR_API_KEY or login)
  4. ✅ Working directory permissions
  5. ✅ Network connectivity

Common Issues

Q: Task exits immediately after starting

  • Check Cursor authentication status
  • Ensure working directory has code

Q: tmux session not found

  • Run use_cursor_list to check active sessions
  • May have been killed or timed out

Q: Garbled output

  • tmux encoding issue, try export LANG=en_US.UTF-8

Security FAQs

Q: Does this skill send my code to external servers?

  • A: No. Code stays on your machine. Cursor CLI may send to Anthropic/Claude API (that's how Cursor works).

Q: Can this skill access my Cursor API key?

  • A: It can detect if $CURSOR_API_KEY is set, but doesn't log or transmit it.

Q: Is my email address exposed?

  • A: No. Email is redacted to ***@domain.com in all outputs.

Q: Can malicious input cause shell injection?

  • A: v1.0.0+ escapes all shell arguments. Earlier versions had this risk.

📁 File Structure

use-cursor/
├── SKILL.md              # This document
├── scripts/
│   ├── spawn.sh          # Start background task
│   ├── check.sh          # Check status
│   ├── send.sh           # Send instructions
│   ├── kill.sh           # End task
│   └── doctor.sh         # Diagnose environment
├── extensions/
│   └── use-cursor/
│       └── index.js      # OpenClaw tool definitions
└── examples/
    └── openclaw.json     # Configuration example

🔗 References


*Version: 1.0.1* *Merged from: cursor-agent (2.1.0) + openclaw-cursor-agent (1.0.0)* *Authors: Bruce + 凤雏 🦞* *Skill Name: use-cursor*

Changelog

v1.0.4 (2026-03-31)

  • ✅ Fixed: Newline/control character injection vulnerability - now sanitized before escaping
  • ✅ Added: Control char removal (/[\-\\]/g) to prevent all tmux control sequence attacks
  • ✅ Updated: SECURITY.md with sanitization documentation
  • ✅ Fixed: Documentation mismatch - changed "JSON.stringify()" to "single-quote method" in SECURITY.md
  • ✅ Fixed: Repository/homepage URLs updated to openclaw/skills (no more placeholders)
  • ✅ Fixed: Added source field to manifest.json for provenance tracking
  • ✅ Enhanced: Detailed code comments explaining why child_process is safe
  • ✅ Clarified: Static analysis flag (child_process) is FALSE POSITIVE for this use case
  • ✅ Updated: manifest.json notes with child_process justification

v1.0.1 (2026-03-31)

  • ✅ Fixed: spawn-isolated.sh cd command now uses -l flag
  • ✅ Verified: ALL tmux send-keys use literal mode (-l)
  • ✅ Updated: manifest.json with detailed security notes
  • ✅ Clarified: Default mode inherits env, isolated mode uses env -i

v1.0.0 (2026-03-31)

  • Initial release with security hardening

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

94.7%
按下载量换算1,174

安全审计

VirusTotal

可疑

ClawScan

通过

Static analysis

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills