Skip to content

CLI and headless usage

Run openmax in a project directory for the terminal interface. Use -p to run a prompt and exit.

Run from a script

Configure a model and trust the project before running a prompt.

openmax -p "Summarize the public API in this repository"
openmax -p --json "List the integration tests"

In plain print mode, Open Max writes the answer to stdout and tool progress and errors to stderr. With --json, it writes one event per line to stdout.

A headless run declines approval requests. For unattended changes, use a trusted project in auto mode. If an authorized CI setup must grant trust without a terminal, set OPENMAX_HUMAN_ATTEST=1 on the command that grants trust. A new grant via --trust-project records auto. Open Max retains the saved mode of an already trusted project.

OPENMAX_HUMAN_ATTEST=1 openmax --trust-project -p "Summarize the test results"
Exit codeResult
0Every turn completed.
1A turn or session failed.
2Usage or configuration error, or no session to continue.
3The project lacks trust or the process cannot grant it.
4The turn stopped before completion.

Run a sub-agent in a worktree

openmax --subagent "Fix the flaky retry test" --worktree

Open Max gives the child a separate session and a Git worktree at the current HEAD. If the child makes changes, Open Max commits them to a separate branch and reports the branch when the child exits.

See the CLI reference for flags, timeouts, exit codes, key bindings, and slash commands. For applications that need a two-way connection, use the stdio protocol.