Learn how to write scripts using Cursor CLI for automated code analysis, generation, and modification
-p, --print
) for non-interactive scripting and automation.
--print
with --force
to modify files in scripts:
--force
flag allows the agent to make direct file changes without confirmation--output-format text
for readable responses:
--output-format json
for structured analysis:
--output-format stream-json
for real-time progress tracking: