id = "cursor" name = "Cursor CLI" homepage = "https://cursor.com/docs/cli" description = "The AI code editor, and the agent it ships for the command line." icon = "theSVG:cursor/light" # The installed shim is also called `agent`, but that name is far too generic # to attribute a usage event with, so only the unambiguous one is listed. executables = ["cursor-agent"] [dotfiles] paths = [ "~/.cursor/cli-config.json", "~/.cursor/hooks.json", "~/.cursor/mcp.json", "~/.cursor/rules/", "~/.cursor/commands/", ] exclude = [ "~/.cursor/projects/", "~/.cursor/chats/", "~/.cursor/agents/", "~/.cursor/plans/", "~/.cursor/snapshots/", "~/.cursor/worktrees/", "~/.cursor/extensions/", "~/.cursor/plugins/", "~/.cursor/skills-cursor/", "~/.cursor/ai-tracking/", "~/.cursor/agent-cli-state.json", "~/.cursor/ide_state.json", "~/.cursor/statsig-cache.json", "~/.cursor/argv.json", ] # Cursor keeps CLI credentials in the OS keychain, not under ~/.cursor. secret = [] # Hook commands and MCP server launches are absolute paths on this machine. # They are also the user's own wiring, and they have to be put back by hand # after a rebuild, so both rules keep their value: backup. [[dotfiles.machine_lines]] file = "~/.cursor/hooks.json" match = { key_path = ["hooks.*.*.command"] } scope = "backup" [[dotfiles.machine_lines]] file = "~/.cursor/mcp.json" match = { key_path = ["mcpServers.*.command", "mcpServers.*.args"] } scope = "backup" [commands] format = 1 label = "Run Cursor agent" description = "Start the Cursor agent with an optional prompt, in interactive or print (non-interactive) mode. Subcommands, MCP, worktree and auth flags are left out." quality = "ai-draft" parser = { end_of_options = "--", interleave = "permute", long_equals = false, short_attached = false, short_bundles = false } [[commands.source]] id = "help" kind = "help" url = "https://cursor.com/docs/cli" revision = "cursor-agent --help 2026-10-27" evidence = """ Usage: agent [options] [command] [prompt...] prompt Initial prompt for the agent -p, --print Print responses to console (for scripts or non-interactive use). Has access to all tools, including write and shell. (default: false) --output-format Output format (only works with --print): text | json | stream-json (default: "text") --mode Start in the given execution mode. plan: read-only/planning (analyze, propose plans, no edits). ask: Q&A style for explanations and questions (read-only). (choices: "plan", "ask") --plan Start in plan mode (shorthand for --mode=plan). (default: false) --continue Continue previous session (default: false) --model Model to use (e.g., gpt-5, sonnet-4-thinking). -f, --force Force allow commands unless explicitly denied (default: false) --workspace Workspace directory or saved workspace name to use (defaults to current working directory) """ [[commands.field]] id = "prompt" label = "Prompt" type = "string" position = 0 sources = ["help"] [[commands.field]] id = "print" label = "Print mode (non-interactive)" description = "Prints the response and exits; the agent has access to all tools including write and shell." type = "boolean" option = ["--print", "-p"] sources = ["help"] [[commands.field]] id = "output_format" label = "Output format" description = "Only works with print mode." type = "enum" option = ["--output-format"] choices = [{ value = "text", label = "Text" }, { value = "json", label = "JSON" }, { value = "stream-json", label = "Streaming JSON" }] sources = ["help"] [[commands.field]] id = "mode" label = "Mode" type = "enum" option = ["--mode"] choices = [{ value = "plan", label = "Plan (read-only)" }, { value = "ask", label = "Ask (read-only Q&A)" }] sources = ["help"] [[commands.field]] id = "model" label = "Model" type = "string" option = ["--model"] suggestions = [{ value = "gpt-5", label = "gpt-5" }, { value = "sonnet-4-thinking", label = "sonnet-4-thinking" }] sources = ["help"] [[commands.field]] id = "continue_session" label = "Continue previous session" type = "boolean" option = ["--continue"] sources = ["help"] [[commands.field]] id = "workspace" label = "Workspace" type = "path" option = ["--workspace"] path = { kind = "directory", role = "input" } sources = ["help"] [[commands.field]] id = "force" label = "Force allow commands" description = "Allows commands unless explicitly denied." type = "boolean" option = ["--force", "-f"] effect = "exec" sources = ["help"] [[commands.task]] id = "ask" label = "Ask a question (read-only)" fields = ["prompt", "mode"] required = ["prompt"] set = { mode = ["ask"] } [[commands.task]] id = "script" label = "Non-interactive run" fields = ["prompt", "print", "output_format", "model"] required = ["prompt"] set = { print = [true] } [[commands.group]] id = "basic" label = "Basic" fields = ["prompt", "print", "mode", "model"] [[commands.group]] id = "advanced" label = "Advanced" fields = ["output_format", "continue_session", "workspace", "force"]