Skip to main content

Cursor Local

The cursor adapter runs Cursor Agent CLI locally. It supports resumable sessions, skills injection, and structured stream output.

Prerequisites

  • Cursor CLI installed (agent command available)
  • A working Cursor account/session if the CLI requires it in your environment

Configuration Fields

FieldTypeRequiredDescription
cwdstringYesWorking directory for the agent process (absolute path; created automatically if missing when permissions allow)
modelstringNoCursor model id (defaults to auto)
modestringNoCursor execution mode passed as --mode (plan or ask)
instructionsFilePathstringNoAbsolute path to the bundle entry file Baton prepends to the run prompt
promptTemplatestringNoPrompt used for all runs
commandstringNoCLI executable name (defaults to agent)
extraArgsstring[]NoAdditional CLI args
envobjectNoEnvironment variables
timeoutSecnumberNoProcess timeout
graceSecnumberNoGrace period before force-kill

Session Persistence

Cursor resumes sessions with --resume when the stored session cwd matches the current cwd.

Skills Injection

Baton auto-injects local skills into ~/.cursor/skills when they are missing so Cursor can discover Baton skills on local runs.

Instructions And Project Context

Cursor local receives:

  • the agent bundle entry file from instructionsFilePath
  • any composed project instructions Baton generates from project conventions and governance reminders

This keeps reusable role behavior separate from project-specific context while still presenting one effective runtime prompt.

Execution Notes

Baton runs Cursor with structured stream output and pipes prompts through stdin. Baton also auto-adds --yolo unless one of --trust, --yolo, or -f is already present in extraArgs.

Environment Test

The environment test checks:

  • Cursor CLI is installed and accessible
  • the working directory is absolute and available (auto-created if missing and permitted)
  • authentication or login state is available if Cursor requires it
  • a live hello probe (agent -p --output-format stream-json --verbose with prompt Respond with hello.) to verify the CLI can run