• Loading…

Scripting with --print

Run one task without the prompt, from a script or a scheduled job, and act on how it ended.

One task, then exit

soreqen --print "run the tests and fix what fails"

--print (or -p) runs the instruction once and exits. There is no prompt, so it suits scripts, scheduled jobs and other tools.

It needs a model to be set up already, by soreqen login or a key. Where there is none, it exits with an error instead of asking.

Exit codes

CodeMeaning
0Done.
1Failed.
2Stopped short of finishing.
130Cancelled.
soreqen -p "update the changelog for the release" || echo "needs a look"

Choosing what it may do

The mode still applies. For a report that must not change anything, use Plan:

soreqen -p --mode plan "explain how authentication works here"

To set a hard limit regardless of the mode, add a tier:

soreqen -p --tier read_only "list the endpoints that skip the auth check"