mohManual

Manual/Going further

Scripts, CI and usage reports

Chapter 12 · 2 min read

The same engine that runs the interface can run without it: in a script, a scheduled job, or CI (the automatic checks that run on every change to a repository).

One task, no interface

moh run "update the changelog for the last release"

moh works through the task and exits. Every event is printed as a line of JSON — easy for other programs to read — and saved to a normal session, so you can open it later in the interface to see what happened.

OptionUse
--provider endpoint/modelPick the model for this run.
--allow "bash:npm test"Allow an action for this run (repeatable).
--deny "bash:git push"Refuse an action for this run (repeatable).
--resume [query]Continue an earlier conversation of this project.
--max-iterations 100Cap how many steps one turn may take.

When nobody can answer

Without a person in front of the screen, there is nobody to approve an action. So moh never waits: anything that would need a question is refused, the refusal is recorded, and the AI is told so it can try another way. A run never hangs on a prompt.

ci
$ moh run "update the changelog"
✓ edit CHANGELOG.md
◌ permission bash · git push
✕ denied · no one to ask in a headless run
Allow what the job needs with --allow, and nothing else.

Exit codes: 0 the turn completed (a refused action is not a failure), 1 the turn failed, 130 it was cancelled, 2 the command was used wrongly.

Careful

--auto-accept and --yolo exist, but in automation an explicit --allow list is almost always the better choice: it says exactly what the job may do.

Usage reports

Everything below is computed on your machine from your own conversation files — there is no phone-home.

$ moh usage                          # per model: calls, tokens, estimated cost
$ moh usage tools                    # per tool: calls, success rate, timeouts
$ moh usage routes                   # fallbacks: from which model to which, and why
$ moh usage --days 7                 # only the last week
$ moh usage export --format csv      # numbers only, no message content

Estimated costs use approximate published prices; a model without a known price shows tokens only, never a made-up figure.

The manual, from the terminal

moh manual prints the built-in manual, and moh --help lists every command. The keys and commands page has the full list.

Written for moh 0.61. Inside moh, ctrl+h opens the built-in manual for your exact version.