Skip to main content
Two entry points work without a terminal, so they are safe in pipelines where the TUI refuses to start: 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.
--skip-permissions-unsafe bypasses every permission check and cannot be combined with --auto. Use it only in a disposable environment — an isolated container or an ephemeral runner with no credentials. Never on a developer machine, a shared runner, or anything holding secrets.

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

A turn is one complete request/response cycle with the model.

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

  1. Start at read-only and raise autonomy only when the task needs it. A review job never needs write access.
  2. Always set --timeout and --max-turns in CI. They are the difference between a failed job and a runner that hangs.
  3. Use -o json or -o stream-json when something downstream parses the output.
  4. Keep the transcript. -o stream-json … | tee run.jsonl is your audit trail.
  5. Pass credentials through the environment, never on the command line. See Sign in.