About gemini
A skill that routes one-shot tasks to Cursor’s headless CLI through a helper script. It is intended for users who want autonomous execution, planning, or Q&A from the current workspace or a specified project directory.
Key features
- 01Run Cursor headlessly for one-shot tasks
- 02Pass prompts through a helper script
- 03Choose plan or ask mode
- 04Set a project directory or model
- 05Return Cursor output and errors
Use cases
- 01Delegate a task from a skill invocation
- 02Request read-only planning or explanations
- 03Run Cursor against another project directory
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ petekp/ claude-code-setup --skill geminiAfter installing, type/geminiin Claude Code to confirm it loaded.
Bundled filesscripts/run-cursor.sh
Details
From the project READMEGemini
Use the Cursor headless CLI (cursor agent --print) for one-shot autonomous execution.
Workflow
- Strip the leading
/geminitoken and preserve everything after it verbatim. - If the remaining prompt is empty, ask the user what Cursor should do.
- Resolve
scripts/run-cursor.shrelative to this skill directory and pipe the prompt to it on stdin. - Share Cursor's output with the user.
- If Cursor changed files or made a concrete recommendation, summarize the important result in plain language.
Invocation
Default invocation from the current working directory:
PROMPT="<everything after /gemini>"
printf '%s' "$PROMPT" | "<skill-dir>/scripts/run-cursor.sh"
Useful options:
--cd /path/to/projectto run Cursor against a different working directory--mode planfor read-only planning/analysis (no file edits)--mode askfor Q&A explanations (read-only)--model <model>to override the default model (e.g.,gpt-5,sonnet-4,sonnet-4-thinking)
Behavior
The helper script:
- checks that
cursoris available onPATH - uses
--print --force --trust --output-format textfor clean headless execution - uses
--workspaceto set the working directory - captures stdout and stderr separately to a temp directory
- returns only Cursor's text output on success
- fails clearly if Cursor exits non-zero or produces no output
Notes
- Do not describe this as a background dispatch unless you are actually using a background-capable shell tool.
- If Cursor fails, show the relevant error output instead of silently retrying.
- If
cursoris missing, tell the user that Cursor CLI is not installed or not onPATH. - Authentication uses the
CURSOR_API_KEYenv var or priorcursor agent login.
Comments
Markdown supported