Headless mode runs a single prompt without the interactive TUI. It is intended for scripts, CI jobs, and programmatic integrations.
Basic usage
m31a -p "Explain the architecture of this codebase"
m31a --prompt "Run tests and summarize failures"The -p/--prompt prompt is appended to any input received on stdin, so you can pipe context into the agent:
cat error.log | m31a -p "Group these errors by root cause"-p cannot be combined with a positional prompt or with -i.
Prompt and continue interactively
m31a -i "Start by reading the README"--prompt-interactive executes the prompt and then keeps the TUI open.
Output formats
Use --output-format (-o) with one of:
| Format | Description |
|---|---|
text | Plain human-readable output (default). |
json | A single structured JSON result. |
stream-json | Newline-delimited JSON events as the run progresses. |
m31a -p "Summarize the failing tests" --output-format json
m31a -p "Run tests and summarize failures" --output-format stream-jsonoutput.format in settings provides the same default for interactive runs.
Raw output
--raw-output disables sanitization of model output, allowing ANSI escape sequences. This can be unsafe with untrusted output; --accept-raw-output-risk suppresses the warning. Prefer the default sanitized output in automation.
Integrations in CI
A typical CI step:
export NVIDIA_API_KEY="nvapi-..."
node bundle/m31a.js -p "Review the diff for security issues" \
--output-format json > review.jsonThe release workflow uses the bundled entry point bundle/m31a.js, so the same command works in environments without a global install.
ACP mode
For IDE-style clients that need a bidirectional protocol, use --acp instead of headless prompts. See ACP.
Next steps
See the CLI reference for every flag and validation rule.