Both use the Cloud runtime unless
CORTEX_COMPUTER selects This PC or SSH — see Configuration.
cortex exec
Give it a prompt
Autonomy
There is nobody to ask in headless mode, so--auto is the safety control that matters.
Output formats
-o / --output-format:
--response-format text|json|json_object shapes what the model returns; --output-schema takes inline JSON or a schema file for structured output.
Add context
Limits
Choose tools
Other flags
cortex exec --help has the complete list.
cortex run
Interactive-adjacent: streams a formatted answer into your terminal and understands sessions.
--format default|json|jsonl (alias --output); --copy puts the answer on the clipboard; --output-file writes it to disk; --notification raises a desktop notification when done.
Examples
GitHub Actions
cortex github install scaffolds workflows for pull-request review and issue automation if you would rather not write the YAML.
GitLab CI
A shell script
Continue a session across invocations
Practices worth keeping
- Start at
read-onlyand raise autonomy only when the task needs it. A review job never needs write access. - Always set
--timeoutand--max-turnsin CI. They are the difference between a failed job and a runner that hangs. - Use
-o jsonor-o stream-jsonwhen something downstream parses the output. - Keep the transcript.
-o stream-json … | tee run.jsonlis your audit trail. - Pass credentials through the environment, never on the command line. See Sign in.
Related
- Modes and permissions
- Sessions
- Cortex Security — the GitHub App alternative for pull-request review.

