Headless mode (exec)
Run hipmmcode non-interactively from scripts, CI, cron jobs, or other programs.
hipmmcode "what's the latest tokio release?" # positional prompt → exec
hipmmcode exec "fix the failing test" # explicit form
cat report.md | hipmmcode "summarize this" # stdin as context
echo "prompt" | hipmmcode # stdin as the promptNon-zero exit on failure — safe to gate CI steps on.
Output formats
| Flag | Output |
|---|---|
| (default) | Final assistant text, plain |
--json / --output-format json | One JSON envelope: result text, usage, cost, session id, exit metadata |
--stream / --output-format stream-json | NDJSON — one event per line as the run progresses (tool calls, text deltas, result) |
Extra stream detail: --include-partial-messages (per-token deltas), --include-hook-events (hook lifecycle frames), --prompt-suggestions (predicted next user message), --verbose.
Structured output
Force the answer to conform to a JSON Schema — validated, with automatic retry on mismatch:
hipmmcode --print --json-schema '{"type":"object","properties":{"version":{"type":"string"}},"required":["version"]}' \
"what is the latest stable Rust version?"Limits & budgets
hipmmcode --max-turns 8 "..." # cap tool-use iterations (default 200)
hipmmcode --max-budget-usd 0.50 "..." # hard spend ceiling — run stops when reachedBudget exhaustion is reported in the result envelope (budget_exceeded).
System prompt control
| Flag | Effect |
|---|---|
--system-prompt <text> / --system-prompt-file <f> | Replace the lead system prompt entirely (exec only) |
--append-system-prompt <text> / --append-system-prompt-file <f> | Append to the default prompt (repeatable) |
--dump-system-prompt | Print the fully-assembled prompt and exit (no model call) |
--no-memory | Skip injecting persistent memory files |
--exclude-dynamic-system-prompt-sections | Move per-machine sections to the first user message for better prompt-cache reuse |
Sessions in headless runs
Headless runs persist sessions by default (resumable later):
hipmmcode --resume sess_abc "continue where we left off"
hipmmcode -c "one more thing" # continue the most recent session
hipmmcode --fork-session --resume sess_abc "try a different approach"
hipmmcode --no-session-persistence "throwaway question"Autonomy helpers
# Keep going until a condition is met (verified by a cheap evaluator model):
hipmmcode --goal "all tests pass" "fix the test suite"
# End-of-run memory extraction (self-evolution):
hipmmcode --auto-memory "refactor the config loader"goalMaxContinuations (default 25) bounds --goal; goalEvaluatorModel picks the evaluator.
Permissions without a human
Headless runs have no one to click "allow". Options:
| Flag | Behavior |
|---|---|
| (none) | ask-rule decisions fail closed (denied) |
--dangerously-skip-permissions | Bypass all prompts (except explicit deny rules) |
--permission-mode acceptEdits | Auto-approve file edits, still deny risky bash |
--permission-webhook <url> | POST each decision to your service; reply {"behavior":"allow"|"deny"|"allow_always"} |
--permission-prompt-tool <mcp-tool> | Route decisions to an MCP tool |
--ask-webhook <url> | POST AskUserQuestion calls to your service; reply {"answers":[…]} |
See Permissions for rule syntax.
Tool surface control
hipmmcode --allowed-tools Bash,Read,Grep "..." # allowlist (FileRead still works as alias)
hipmmcode --disallowed-tools WebSearch "..." # denylist (applied after allowlist)
hipmmcode --bare "..." # fast start: skip skills/MCP/hooks, tools narrowed to Bash+Read+Edit
hipmmcode --safe-mode "..." # troubleshooting: disable ALL customizationsScheduled runs
hipmmcode cron list # durable tasks in <cwd>/.hipmmcode/scheduled_tasks.json
hipmmcode cron daemon --interval 60 # out-of-process scheduler: poll + fire tasks headlesslyExit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Error (flag / config / auth / network) |
2 | Bad JSON args or a blocking hook |
| non-zero | max-turns cap, budget ceiling, or schema-validation retry exhaustion |
For long-lived integrations, prefer the server & task queue or the SDK protocol. The complete machine-integration handbook is embedded in the binary: hipmmcode integration.