Get a scriptable answer in print mode
print mode & automation
// what it does
-p (or --print) runs the agent non-interactively: it prints the final response and exits, with no TUI. Print mode is also inferred automatically when stdout is not a TTY or stdin is piped, so it usually kicks in inside scripts and CI without the flag. Default output is plain text.
// shell
$ cursor-agent -p "list all TODO comments in this repo"// gotcha
Because print mode is inferred from a non-TTY, the agent can run non-interactively — with no approval prompts — inside scripts and pipelines even when you did not pass -p. Combined with --force that means unattended writes and shell, so scope permissions before piping into it.