with one click
cursor-agent
// Use the Cursor CLI (agent) for software engineering tasks. Includes installation, auth, commands, terminal-based automation, and best practices for AI coding workflows.
// Use the Cursor CLI (agent) for software engineering tasks. Includes installation, auth, commands, terminal-based automation, and best practices for AI coding workflows.
| name | cursor-agent |
| version | 3.0.0 |
| description | Use the Cursor CLI (agent) for software engineering tasks. Includes installation, auth, commands, terminal-based automation, and best practices for AI coding workflows. |
| author | Pushpinder Pal Singh |
| playground | {"repo":"dustland/openviber","file":"src/skills/cursor-agent/index.ts"} |
This skill provides expert knowledge for using the Cursor CLI (agent / cursor-agent). When the user asks to use this skill or run the Cursor CLI, use your available tools (their descriptions tell you when to call them). The Cursor CLI requires a real terminal (PTY) — the terminal skill provides persistent sessions for this.
Install (macOS/Linux/WSL):
curl https://cursor.com/install -fsS | bash
macOS (Homebrew): brew install --cask cursor-cli
PATH: Add $HOME/.local/bin to PATH in ~/.zshrc or ~/.bashrc, then source it.
Verify: agent --version or cursor-agent --version
agent loginexport CURSOR_API_KEY=your_api_key_hereagent or agent "Add error handling to this API"agent -p 'Run tests and report coverage' or agent --print 'Refactor this file'agent models or agent --model gpt-5agent ls, agent resume, agent --resume="[chat-id]"/models – switch models/compress – summarize conversation/rules – edit rules/commands – custom commands/mcp enable|disable [server-name] – MCPThe quality of the Cursor agent's output depends heavily on the prompt. Follow these guidelines:
Be specific about files and locations:
Include context about the codebase:
State acceptance criteria:
Git workflow is automatic for coding tasks:
For multi-step tasks, break them down:
agent -p (non-interactive) for automated workflowsCursor agent reads rules from these locations (in order):
.cursor/rules — Project-specific rules directoryAGENTS.md — Agent instructions at project rootCLAUDE.md — Claude-specific instructions at project root.cursorrules — Legacy rules fileBest practice: Create an AGENTS.md in the project root with:
Cursor agent supports MCP (Model Context Protocol) servers defined in mcp.json:
/mcp in interactive sessionCRITICAL: The Cursor CLI requires a real TTY. Running agent or agent -p "..." directly from a subprocess or script will hang indefinitely.
Solution: The terminal skill provides persistent terminal sessions. Use terminal_check first to verify the backend is available.
terminal_check).terminal_new_session, send keys with terminal_send_keys, read output with terminal_read.What does NOT work: Running agent "task" or agent -p "task" directly from Node/scripts without a PTY — it will hang.
The cursor_agent_run tool:
sessionName valuesParameters:
goal (required): Detailed task prompt — be specific (see best practices above)cwd (optional): Project root directorywaitSeconds (optional): Maximum wait time (default: 120s, polls every 3s)sessionName (optional): Session name for parallel runs (default: 'cursor-agent')Return shape:
ok: boolean — whether the agent completed within the time limitstatus: 'completed' | 'timed_out' | 'error'summary: one-line status stringoutputTail: last ~100 lines of terminal output (chat-friendly)output: full captured output (truncated if very large)elapsed: seconds spenthint: guidance when timed out or erroredFor large tasks, run multiple agents in parallel with distinct session names:
cursor_agent_run({ goal: "Fix auth module tests", cwd: "/project", sessionName: "cursor-auth" })
cursor_agent_run({ goal: "Update API documentation", cwd: "/project", sessionName: "cursor-docs" })
Check status of all sessions with terminal_list.
gh_get_issue → Read the full issuegh_clone_repo → Clone (or pull latest)cursor_agent_run → Fix the issue with a prompt describing the issue and requirements
Note: The Cursor agent can execute git commands directly. The cursor_agent_run tool automatically enhances your prompt with git workflow instructions for coding tasks in git repositories, so you can focus on describing what needs to be done rather than how to manage branches and PRs.
agent -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. Ensure all tests pass.'
agent -p 'Analyze the following error and suggest a fix: [paste error]. The error occurs in src/api/handler.ts.'
.cursor/rules, AGENTS.md, CLAUDE.md.mcp.json; enable/disable with /mcp in session.[HINT] Download the complete skill directory including SKILL.md and all related files