Automation and CI
Print mode#
Pass -p with the prompt:
agent -p "find and fix performance issues" --model "gpt-5"Select the output format when a later step has to parse the result:
agent -p "review these changes for security issues" --output-format textWhat automation suits#
Non-interactive runs work best where the output is advisory and a human reads it. Reviewing a diff for a specific class of problem, summarizing what changed, or flagging missing test coverage all fit: the agent produces a comment, and a person decides what to do.
Be deliberate about anything that commits, pushes, or deploys. In an interactive session you see each command before approving it; in a pipeline there is no such checkpoint. Scope pipeline credentials accordingly, and prefer having the agent open a pull request over having it push to a protected branch.
Choosing a model in CI#
Pipelines run often, so model choice compounds. A mid-tier model is usually right for routine review passes; reserve premium models for jobs where the analysis is genuinely hard. See models and pricing.
Related#
- CLI overview — interactive modes
- Sessions — stateful conversations
- Models and pricing — cost per run