Skip to content

Add Cursor and Grok harnesses - #2

Open
ethanolivertroy wants to merge 2 commits into
benja:mainfrom
ethanolivertroy:pr/grok-cursor
Open

Add Cursor and Grok harnesses#2
ethanolivertroy wants to merge 2 commits into
benja:mainfrom
ethanolivertroy:pr/grok-cursor

Conversation

@ethanolivertroy

Copy link
Copy Markdown

Adds two new harnesses to the existing Codex / Claude Code / OpenCode / Pi set.

Cursor

  • Spawns cursor-agent (env override: ASK_CURSOR_BIN, e.g. cursor-work-agent)
  • Read-only: --mode ask (Q&A mode makes no edits), --trust for headless runs
  • Streams stream-json partials with --stream-partial-output; final untimestamped assistant message is the answer, result event carries the session ID
  • Session resume via --resume <chat_id>
  • models() parses the cursor-agent models table (auto, composer family, codex, cursor-grok, opus, etc.)

Grok

  • Spawns grok (env override: ASK_GROK_BIN), xAI Grok Build CLI
  • Read-only: --permission-mode plan, plus --no-auto-update for scripts
  • Parses streaming-json NDJSON events (text deltas, error, terminal end with session_id)
  • Session resume via --resume <session_id>
  • Models from grok models; hardcoded xAI reasoning effort levels (minimal/low/medium/high) since the CLI reports none

Notes

  • Both CLIs install a binary named agent; ask calls the unambiguous cursor-agent name for Cursor so the two never collide
  • Grok's streaming-json event schema was verified against the xai-org/grok-build source; the Cursor harness was live-tested end-to-end (one-shot, continue, session list)
  • cargo fmt --check, cargo test --locked, cargo clippy --locked --all-targets -- -D warnings all pass (89 tests)

- Cursor: spawns cursor-agent/agent in ask mode (--mode ask), streams
  stream-json partials, resumes via --resume, lists models from the
  CLI model table; ASK_CURSOR_BIN override.
- Grok: spawns grok (PATH or ~/.grok/bin) in read-only plan mode,
  parses streaming-json events (text/end/error), resumes via --resume,
  hardcodes xAI reasoning effort levels; ASK_GROK_BIN override.
- Register both in DEFINITIONS with aliases and tests; document in README.
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