Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Running a prompt without the screen

uji run sends one prompt, lets the model work until it answers, prints the answer and exits. Scripts and other programs use it, and so do the agents of the subagent plugin. It reads the same config, plugins and packs as uji does on the screen, and saves the conversation as a session.

uji run "Summarise what changed in the last commit"

The words after the options form the prompt. The exit code is 0 when the model answers and 1 when the turn fails, with the reason on standard error.

OptionDoes
--jsonPrints every event as a line of JSON instead of the answer alone.
--model <PROVIDER/ID>Uses this model instead of the one you picked with /models.
--effort <LEVEL>Uses this reasoning effort: off, minimal, low, medium or high.
--tools <A,B>Offers the model only these tools, separated by commas.
--append-prompt <TEXT>Adds the text to the end of the system prompt.
--title <TEXT>Titles the session. The default is the first line of the prompt.
--parent <ID>Saves the session under another one. uji list leaves it out, and uji resume --id opens it.

Nobody can answer an approval question here, so a call your policy would ask about runs without asking. Calls your policy denies stay denied.

The options --config-dir, --data-dir and --db work as they do for the other commands.

JSON events

With --json, each line is one event.

typeFieldsWhen
sessionidFirst, with the id of the new session.
messagemessageA message joined the conversation, in the form uji saves it.
progresstool, lineA running tool printed a line.
noticetextuji has something to tell you, such as a plugin error.
donetext or error, and usageLast. usage has input, output, cache_read and cache_write tokens for the whole run.
uji run --json --tools read_file "What does src/main.rs do?" | jq -r 'select(.type == "done") | .text'