Skip to content

feat(agents): add Cursor agent support with improvements#264

Merged
subsy merged 7 commits intomainfrom
feature/cursor-agent-improved
Feb 3, 2026
Merged

feat(agents): add Cursor agent support with improvements#264
subsy merged 7 commits intomainfrom
feature/cursor-agent-improved

Conversation

@subsy
Copy link
Copy Markdown
Owner

@subsy subsy commented Feb 3, 2026

Summary

Adds Cursor CLI as a new agent option for Ralph TUI, based on PR #240 with additional improvements.

New Features

  • Cursor Agent Plugin - Full integration with Cursor's CLI for AI-assisted coding
  • Configurable execution modes: agent, plan, ask
  • Auto-approve (--force) support for autonomous operation
  • JSONL streaming with subagent tracing support
  • Model selection support

Improvements over original PR #240

  • Extracted shared utility - extractErrorMessage moved to src/plugins/agents/utils.ts (was duplicated in codex, cursor, gemini)
  • Fixed CLI command name - Changed from agent to cursor (the actual binary name)
  • Fixed install URL - Points to docs.cursor.com/cli instead of non-existent URL
  • Added documentation - Full docs at /docs/plugins/agents/cursor
  • Added to navigation - Cursor now appears in website nav

Test plan

  • bun run typecheck passes
  • bun run build passes
  • All 188 agent tests pass (cursor, codex, gemini)
  • Manual test with actual Cursor CLI

Related

Summary by CodeRabbit

  • New Features

    • Added Cursor Agent plugin with multi-mode execution (agent/plan/ask), force mode, configurable model selection and real-time JSONL streaming.
  • Documentation

    • Added full Cursor Agent docs with examples, options, workflows and troubleshooting; navigation updated.
  • Tests

    • Comprehensive test suite for Cursor CLI parsing, setup and execution behaviours.
  • Chores

    • Added shared error-extraction utility, registered Cursor as a supported agent, and bumped package version.

Scott Terry and others added 5 commits January 29, 2026 13:42
Remove special handling for nested tool_call object format. The cursor
agent now uses the standard event.name and event.input fields directly.
…or agent

Changes:
- Extract duplicate extractErrorMessage function to shared utils.ts
- Update codex.ts, cursor.ts, gemini.ts to use shared utility
- Fix Cursor CLI command name from 'agent' to 'cursor'
- Fix Cursor install URL to point to docs.cursor.com/cli
- Add comprehensive documentation for Cursor agent
- Add Cursor to website navigation
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ralph-tui Ignored Ignored Preview Feb 3, 2026 7:03pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 3, 2026

Walkthrough

Adds a new Cursor CLI agent plugin with JSONL streaming/parsing, centralises an extractErrorMessage utility into a shared module and re-exports it, registers Cursor in the built-in agents, adds comprehensive Cursor tests, updates docs/navigation, and bumps package version.

Changes

Cohort / File(s) Summary
Version & installer
package.json, src/setup/skill-installer.ts
Bumped package version to 0.6.1 and added cursor entry to AGENT_ID_MAP.
Shared error util & re-exports
src/plugins/agents/utils.ts, src/plugins/agents/builtin/codex.ts, src/plugins/agents/builtin/gemini.ts
Added extractErrorMessage in src/plugins/agents/utils.ts and replaced local implementations in codex.ts and gemini.ts with re-exports of the shared util.
Cursor agent implementation
src/plugins/agents/builtin/cursor.ts
New CursorAgentPlugin, createCursorAgent factory, streaming execution that spawns the Cursor CLI, stdin/args handling, JSONL parsing utilities parseCursorJsonLine and parseCursorOutputToEvents, and public exports including CursorAgentPlugin and re-exported extractErrorMessage.
Cursor tests
src/plugins/agents/builtin/cursor.test.ts
New comprehensive test suite for Cursor plugin covering metadata, setup/validation, sandbox requirements, CLI arg construction, stdin handling, extractErrorMessage behaviours, JSONL parsing and edge cases.
Plugin registry
src/plugins/agents/builtin/index.ts
Registered and exported createCursorAgent and CursorAgentPlugin in the built-in agents index.
Docs & navigation
website/content/docs/plugins/agents/cursor.mdx, website/lib/navigation.ts
Added Cursor agent documentation page and a new navigation entry under Plugins → Agents.
Contributing docs
CONTRIBUTING.md
Expanded the contribution requirements checklist and acceptance criteria for features, agents and tests.

Sequence Diagram

sequenceDiagram
    participant User
    participant CursorPlugin
    participant CursorCLI
    participant OutputParser
    participant DisplaySystem

    User->>CursorPlugin: execute(prompt, config)
    CursorPlugin->>CursorPlugin: validateSetup & buildArgs
    CursorPlugin->>CursorCLI: spawn process (args + stdin)
    CursorCLI-->>CursorPlugin: stream JSONL stdout
    CursorPlugin->>OutputParser: parseCursorOutputToEvents(data)
    OutputParser->>OutputParser: parseCursorJsonLine()
    OutputParser-->>CursorPlugin: AgentDisplayEvent[]
    CursorPlugin-->>DisplaySystem: emit events (text, tool_use, errors)
    DisplaySystem-->>User: render updates
    CursorCLI-->>CursorPlugin: process exit
    CursorPlugin->>User: execution complete
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding Cursor agent support to the agents plugin system, with a note about improvements.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/cursor-agent-improved

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 52.10280% with 205 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.57%. Comparing base (0c00b11) to head (f4a8239).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/plugins/agents/builtin/cursor.ts 49.87% 203 Missing ⚠️
src/plugins/agents/utils.ts 86.66% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #264      +/-   ##
==========================================
+ Coverage   43.49%   43.57%   +0.08%     
==========================================
  Files          92       94       +2     
  Lines       28358    28756     +398     
==========================================
+ Hits        12334    12531     +197     
- Misses      16024    16225     +201     
Files with missing lines Coverage Δ
src/plugins/agents/builtin/codex.ts 47.84% <100.00%> (-1.18%) ⬇️
src/plugins/agents/builtin/gemini.ts 45.15% <100.00%> (-1.38%) ⬇️
src/plugins/agents/builtin/index.ts 92.00% <100.00%> (+1.09%) ⬆️
src/setup/skill-installer.ts 66.48% <100.00%> (+0.18%) ⬆️
src/plugins/agents/utils.ts 86.66% <86.66%> (ø)
src/plugins/agents/builtin/cursor.ts 49.87% <49.87%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/plugins/agents/builtin/cursor.ts`:
- Around line 109-112: Update the top-of-file/class docstring to reference the
`cursor` command (and the plugin's role as the Cursor CLI) instead of `agent`;
locate the comment block above the plugin class (the docstring that currently
reads "Cursor Agent CLI plugin implementation. Uses the `agent` CLI to execute
AI coding tasks.") and change it to mention `cursor` and/or
`meta.defaultCommand` so it accurately describes the Cursor CLI plugin and
avoids referring to the `agent` command.
🧹 Nitpick comments (1)
website/content/docs/plugins/agents/cursor.mdx (1)

132-136: Clarify the config scope for subagentTracingDetail.

The snippet lacks its enclosing config section, so it is unclear whether it belongs under agentOptions or agents.options. Consider showing the full block to prevent misconfiguration.

💡 Suggested doc tweak
-```toml
-subagentTracingDetail = "full"
-```
+```toml
+[agentOptions]
+subagentTracingDetail = "full"
+```

AI Agent added 2 commits February 3, 2026 19:01
Add detailed checklists for contributors:
- General requirements (>50% test coverage, docs for user-facing changes)
- Complete tracker plugin checklist (source, registration, tests, docs)
- Complete agent plugin checklist (source, registration, tests, docs)

Each checklist includes all required files, methods, tests, and documentation.
@subsy subsy merged commit 952550d into main Feb 3, 2026
9 checks passed
@subsy subsy deleted the feature/cursor-agent-improved branch February 3, 2026 19:09
@coderabbitai coderabbitai bot mentioned this pull request Feb 15, 2026
13 tasks
sakaman pushed a commit to sakaman/ralph-tui that referenced this pull request Feb 15, 2026
feat(agents): add Cursor agent support with improvements
@coderabbitai coderabbitai bot mentioned this pull request Feb 26, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant