Loading...
Loading...
A comprehensive skill for using the Cursor CLI agent for various software engineering tasks (updated for 2026 features, includes tmux automation guide).
npx skill4agent add aaaaqwq/claude-code-skills cursor-agentcurl https://cursor.com/install -fsS | bashbrew install --cask cursor-cli~/.zshrc~/.bashrcexport PATH="$HOME/.local/bin:$PATH"source ~/.zshrc~/.bashrcagent --versionagentcursor-agentagent --versioncursor-agent --versionagent loginexport CURSOR_API_KEY=your_api_key_hereagent update
# or
agent upgradeagentagent "Add error handling to this API"cursor-agentagentagent models
# or
agent --list-modelsagent --model gpt-5/modelsagent lsagent resumeagent --resume="[chat-id]"@filename.ts
@src/components//models/compress/rules/commands/mcp enable [server-name]/mcp disable [server-name]Shift+EnterCtrl+DCtrl+RiArrowUpagent -p 'Run tests and report coverage'
# or
agent --print 'Refactor this file to use async/await'# Plain text (default)
agent -p 'Analyze code' --output-format text
# Structured JSON
agent -p 'Find bugs' --output-format json
# Real-time streaming JSON
agent -p 'Run tests' --output-format stream-json --stream-partial-outputagent -p 'Fix all linting errors' --forceagent -p 'Analyze this screenshot: screenshot.png'# 1. Install tmux if not available
sudo apt install tmux # Ubuntu/Debian
brew install tmux # macOS
# 2. Create a tmux session
tmux kill-session -t cursor 2>/dev/null || true
tmux new-session -d -s cursor
# 3. Navigate to project
tmux send-keys -t cursor "cd /path/to/project" Enter
sleep 1
# 4. Run Cursor agent
tmux send-keys -t cursor "agent 'Your task here'" Enter
# 5. Handle workspace trust prompt (first run)
sleep 3
tmux send-keys -t cursor "a" # Trust workspace
# 6. Wait for completion
sleep 60 # Adjust based on task complexity
# 7. Capture output
tmux capture-pane -t cursor -p -S -100
# 8. Verify results
ls -la /path/to/project/agent# ❌ These will hang indefinitely:
agent "task" # No TTY
agent -p "task" # No TTY
subprocess.run(["agent", ...]) # No TTY
script -c "agent ..." /dev/null # May crash Cursor.cursor/rulesAGENTS.mdCLAUDE.md/rulesmcp.json/mcp enable server-name
/mcp disable server-nameagent -p 'Review the changes in the current branch against main. Focus on security and performance.'agent -p 'Refactor src/utils.ts to reduce complexity and improve type safety.'agent -p 'Analyze the following error log and suggest a fix: [paste log here]'agent -p 'Generate a commit message for the staged changes adhering to conventional commits.'# Set API key in CI environment
export CURSOR_API_KEY=$CURSOR_API_KEY
# Run security audit with JSON output
agent -p 'Audit this codebase for security vulnerabilities' --output-format json --force
# Generate test coverage report
agent -p 'Run tests and generate coverage report' --output-format textagent
# Then in interactive mode:
@src/api/
@src/models/
Review the API implementation for consistency with our data models