Cursor CLI
Announcement: Begin with: "I'm using the cursor-cli skill for cross-AI validation with Cursor."
Use this wrapper for a one-shot Cursor review or approach validation. Read the
shared lifecycle in ../codex-cli/references/cross-ai-run.md first.
Provider adapter
Check command -v agent, agent --version, and agent --help. Verify the
binary is Cursor Agent and supports --print, --mode ask, and
--output-format json. cursor-agent may be an installation alias; do not
substitute the Cursor editor executable.
When the caller requests a particular model or an independent model family,
inspect agent models and select an exact listed slug. Otherwise omit the
model override. Cursor supports multiple providers; auto and an unreported
default do not establish model-level independence. Record the requested slug
separately from any model identity actually reported by the provider.
Resolve the loaded skill directory and run the adapter from the target
repository root with Python 3.10+:
CURSOR_SKILL_DIR="/absolute/path/to/loaded/cursor-cli"
python3 "$CURSOR_SKILL_DIR/scripts/review.py" \
--prompt-file /tmp/cursor-prompt.md \
--file path/to/file.py \
--timeout 120 \
--output-dir /tmp/cursor-review-unique
Set CURSOR_SKILL_DIR to the directory containing this loaded skill, not a
path relative to the reviewed repository. --file is repeatable and pre-reads
verified UTF-8 files into the prompt. The combined input limit is 96 KiB;
narrow larger reviews explicitly. Add --model '<exact listed slug>' only
when selected. Each invocation requires a fresh output directory.
Inspect receipt.json, stdout.json, stderr.log, version.stderr.log, and
response.txt on success. A completed JSON result requires exit 0,
type: result, subtype: success, is_error: false, and a non-empty string
result. An error envelope, timeout, malformed output, trust rejection, or
empty answer is incomplete. Also read the answer for blocked reads, omitted
scope, or other visible limitations: a valid envelope alone does not prove
the review was completed. Return the shared receipt and evidence gaps.
The adapter always uses agent -p --mode ask --output-format json. Print mode
alone can use write and shell tools; keep the explicit read-only mode. Workspace
trust is a separate prerequisite: the adapter preserves a trust rejection and
stops. It does not pass --trust, force/yolo, automatic MCP approval, or sandbox
bypass flags, retry, authenticate, update the CLI, or modify settings. Resolve
missing capabilities or trust through a separate user-authorized action.
Prompt requirements
Include the repository root, task/requirements path when task-attached, changed
files or diff scope, and concrete questions. Cursor starts without this
conversation's context. Resolve task evidence through
../setup/references/task-context.md; standalone calls do not create a task.
When not to use
- The caller did not explicitly choose Cursor
- The request needs interactive refinement
- The primary review workflow already answers the request
References
../codex-cli/references/cross-ai-run.md — shared lifecycle
reference.md — native output contract, trust boundary, and official sources
templates.md — prompt shapes; resolve placeholders before execution
1---2name: cursor-cli-23description: Run Cursor CLI for one-shot cross-AI code review when a Cursor perspective is explicitly wanted. Invoke ONLY when the user asks ('cursor review', 'ask cursor', 'run cursor'), or another skill explicitly delegates to Cursor. Do not invoke it implicitly for a generic review. Not for interactive conversations.4---56# Cursor CLI78> **Announcement**: Begin with: "I'm using the **cursor-cli** skill for cross-AI validation with Cursor."910Use this wrapper for a one-shot Cursor review or approach validation. Read the11shared lifecycle in `../codex-cli/references/cross-ai-run.md` first.1213## Provider adapter14151. Check `command -v agent`, `agent --version`, and `agent --help`. Verify the16 binary is Cursor Agent and supports `--print`, `--mode ask`, and17 `--output-format json`. `cursor-agent` may be an installation alias; do not18 substitute the Cursor editor executable.192. When the caller requests a particular model or an independent model family,20 inspect `agent models` and select an exact listed slug. Otherwise omit the21 model override. Cursor supports multiple providers; `auto` and an unreported22 default do not establish model-level independence. Record the requested slug23 separately from any model identity actually reported by the provider.243. Resolve the loaded skill directory and run the adapter from the target25 repository root with Python 3.10+:2627 ```bash28 CURSOR_SKILL_DIR="/absolute/path/to/loaded/cursor-cli"29 python3 "$CURSOR_SKILL_DIR/scripts/review.py" \30 --prompt-file /tmp/cursor-prompt.md \31 --file path/to/file.py \32 --timeout 120 \33 --output-dir /tmp/cursor-review-unique34 ```3536 Set `CURSOR_SKILL_DIR` to the directory containing this loaded skill, not a37 path relative to the reviewed repository. `--file` is repeatable and pre-reads38 verified UTF-8 files into the prompt. The combined input limit is 96 KiB;39 narrow larger reviews explicitly. Add `--model '<exact listed slug>'` only40 when selected. Each invocation requires a fresh output directory.414. Inspect `receipt.json`, `stdout.json`, `stderr.log`, `version.stderr.log`, and42 `response.txt` on success. A completed JSON result requires exit 0,43 `type: result`, `subtype: success`, `is_error: false`, and a non-empty string44 `result`. An error envelope, timeout, malformed output, trust rejection, or45 empty answer is incomplete. Also read the answer for blocked reads, omitted46 scope, or other visible limitations: a valid envelope alone does not prove47 the review was completed. Return the shared receipt and evidence gaps.4849The adapter always uses `agent -p --mode ask --output-format json`. Print mode50alone can use write and shell tools; keep the explicit read-only mode. Workspace51trust is a separate prerequisite: the adapter preserves a trust rejection and52stops. It does not pass `--trust`, force/yolo, automatic MCP approval, or sandbox53bypass flags, retry, authenticate, update the CLI, or modify settings. Resolve54missing capabilities or trust through a separate user-authorized action.5556## Prompt requirements5758Include the repository root, task/requirements path when task-attached, changed59files or diff scope, and concrete questions. Cursor starts without this60conversation's context. Resolve task evidence through61`../setup/references/task-context.md`; standalone calls do not create a task.6263## When not to use6465- The caller did not explicitly choose Cursor66- The request needs interactive refinement67- The primary review workflow already answers the request6869## References7071- `../codex-cli/references/cross-ai-run.md` — shared lifecycle72- `reference.md` — native output contract, trust boundary, and official sources73- `templates.md` — prompt shapes; resolve placeholders before execution