cursor-agent
Skill17 starsChanged 17 days agoMITView on GitHub
A comprehensive skill for using the Cursor CLI agent for various software engineering tasks (updated for 2026 features, includes tmux automation guide). Use when user wants to run Cursor agent, code with Cursor, or automate development tasks via Cursor CLI.
- Pipes a download into a shell
- Reads credentials
- Installs packages
6 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- AlekseiUL/heisenberg-team-GPTword for word, first seen Nov 1, 2026
- ejarmand/skillstheir own version, first seen Sep 23, 2026
- payne0420/claude-skillstheir own version, first seen Jun 12, 2026
- payne0420/claude-ultracode-agentstheir own version, first seen Jun 8, 2026
- Vesely/skillstheir own version, first seen May 1, 2026
- kunwl123456/zeroclaw-skills-collectionedited, first seen Feb 19, 2026
Other versions6 projects use a version of this.
Word for word · 1
- AlekseiUL/heisenberg-team-GPT★ 9100% same
Edited · 1
- kunwl123456/zeroclaw-skills-collection★ 27100% same
Wrote their own version · 4
- Vesely/skills★ 28same name
- ejarmand/skills★ 1same name
- payne0420/claude-skills★ 0same name
- payne0420/claude-ultracode-agents★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository33 other files it gives its agents.
- AGENTS.mdAGENTS.md
- audit-websiteSkill
- blogwatcherSkill
- brainstormingSkill
- browser-useSkill
- byteroverSkill
- channel-analyzerSkill
- deep-research-proSkill
- excalidrawSkill
- geminiSkill
- github-publisherSkill
- gogSkill
- healthcheckSkill
- landing-builderSkill
- last30daysSkill
- minimax-docxSkill
- minimax-pdfSkill
- minimax-xlsxSkill
- n8n-workflow-automationSkill
- pptx-generatorSkill
- presentationSkill
- product-validatorSkill
- quality-checkSkill
- redditSkill
- researcherSkill
- safeskillmonitorSkill
- skill-and-agent-creatorSkill
- swipe-fileSkill
- systematic-debuggingSkill
- TubeScribeSkill
- tweet-writerSkill
- weatherSkill
- writing-plansSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 8 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Add to PATH in ~/.zshrc (zsh) or ~/.bashrc (bash):
- Very specific: line 43
Verify installation: agent --version or cursor-agent --version
- Distinctive: line 61
Keep your CLI up to date:
- Distinctive: line 73
Start an interactive session with the agent:
- Distinctive: line 79
Start with an initial prompt:
- Distinctive: line 97
Use a specific model:
- Very specific: line 132
/rules: - Create and edit rules directly from CLI - Very specific: line 133
/commands: - Create and modify custom commands - Very specific: line 139
Shift+Enter: - Add newlines for multi-line prompts - Distinctive: line 146
Run the agent in a non-interactive mode, suitable for CI/CD pipelines:
- Distinctive: line 181
CRITICAL: When running Cursor CLI from automated environments (AI agents, scripts, subprocess calls), the CLI requires a real TTY.
- Very specific: line 236
Use /rules command to create and edit rules directly from the CLI.
- Distinctive: line 287
Run automated checks in CI pipelines:
- Distinctive: line 302
Use context selection to analyze multiple files:
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cursor CLI Agent Skill
This skill provides a comprehensive guide and set of workflows for utilizing the Cursor CLI tool, including all features from the January 2026 update.
Installation
Standard Installation (macOS, Linux, Windows WSL)
curl https://cursor.com/install -fsS | bashHomebrew (macOS only)
brew install --cask cursor-cliPost-Installation Setup
macOS:
- Add to PATH in
~/.zshrc(zsh) or~/.bashrc(bash):export PATH="$HOME/.local/bin:$PATH" - Restart terminal or run
source ~/.zshrc(or~/.bashrc) - Requires macOS 10.15 or later
- Works on both Intel and Apple Silicon Macs
Linux/Ubuntu:
- Restart your terminal or source your shell config
- Verify with
agent --version
Both platforms:
- Commands:
agent(primary) andcursor-agent(backward compatible) - Verify installation:
agent --versionorcursor-agent --version
Authentication
Authenticate via browser:
agent loginOr use API key:
export CURSOR_API_KEY=your_api_key_hereUpdate
Keep your CLI up to date:
agent update
# or
agent upgradeCommands
Interactive Mode
Start an interactive session with the agent:
agentStart with an initial prompt:
agent "Add error handling to this API"Backward compatibility: cursor-agent still works but agent is now the primary command.
Model Switching
List all available models:
agent models
# or
agent --list-modelsUse a specific model:
agent --model gpt-5Switch models during a session:
/modelsSession Management
Manage your agent sessions:
- List sessions:
agent ls - Resume most recent:
agent resume - Resume specific session:
agent --resume="[chat-id]"
Context Selection
Include specific files or folders in the conversation:
@filename.ts
@src/components/Slash Commands
Available during interactive sessions:
/models- Switch between AI models interactively/compress- Summarize conversation and free up context window/rules- Create and edit rules directly from CLI/commands- Create and modify custom commands/mcp enable [server-name]- Enable an MCP server/mcp disable [server-name]- Disable an MCP server
Keyboard Shortcuts
Shift+Enter- Add newlines for multi-line promptsCtrl+D- Exit CLI (requires double-press for safety)Ctrl+R- Review changes (pressifor instructions, navigate with arrow keys)ArrowUp- Cycle through previous messages
Non-interactive / CI Mode
Run the agent in a non-interactive mode, suitable for CI/CD pipelines:
agent -p 'Run tests and report coverage'
# or
agent --print 'Refactor this file to use async/await'Output formats:
# 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-outputForce mode (auto-apply changes without confirmation):
agent -p 'Fix all linting errors' --forceMedia support:
agent -p 'Analyze this screenshot: screenshot.png'⚠️ Using with AI Agents / Automation (tmux required)
CRITICAL: When running Cursor CLI from automated environments (AI agents, scripts, subprocess calls), the CLI requires a real TTY. Direct execution will hang indefinitely.
The Solution: Use tmux
# 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/Why this works:
- tmux provides a persistent pseudo-terminal (PTY)
- Cursor's TUI requires interactive terminal capabilities
- Direct
agentcalls from subprocess/exec hang without TTY
What does NOT work:
# ❌ 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 CursorRules & Configuration
The agent automatically loads rules from:
.cursor/rulesAGENTS.mdCLAUDE.md
Use /rules command to create and edit rules directly from the CLI.
MCP Integration
MCP servers are automatically loaded from mcp.json configuration.
Enable/disable servers on the fly:
/mcp enable server-name
/mcp disable server-nameNote: Server names with spaces are fully supported.
Workflows
Code Review
Perform a code review on the current changes or a specific branch:
agent -p 'Review the changes in the current branch against main. Focus on security and performance.'Refactoring
Refactor code for better readability or performance:
agent -p 'Refactor src/utils.ts to reduce complexity and improve type safety.'Debugging
Analyze logs or error messages to find the root cause:
agent -p 'Analyze the following error log and suggest a fix: [paste log here]'Git Integration
Automate git operations with context awareness:
agent -p 'Generate a commit message for the staged changes adhering to conventional commits.'Batch Processing (CI/CD)
Run automated checks in CI pipelines:
# 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 textMulti-file Analysis
Use context selection to analyze multiple files:
agent
# Then in interactive mode:
@src/api/
@src/models/
Review the API implementation for consistency with our data modelsDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

