Prompt, review, and iterate effectively with Cursor CLI
mcp.json
configuration file, enabling the same MCP servers and tools that you’ve configured for the IDE.
.cursor/rules
directory to provide context and guidance to the agent. These rules will be automatically loaded and applied based on their configuration, allowing you to customize the agent’s behavior for different parts of your project or specific file types.
--resume [thread id]
to load prior context.
To resume the most recent conversation, use cursor resume
.
You can also run cursor ls
to see a list of previous conversations.
-p
or --print
to run Agent in non-interactive mode. This will print the response to the console.
With non-interactive mode, you can invoke Agent in a non-interactive way. This allows you to integrate it in scripts, CI pipelines, etc.
You can combine this with --output-format
to control how the output is formatted. For example, use --output-format json
for structured output that’s easier to parse in scripts, or --output-format text
for plain text output.