Skip to content

CLI reference

macbatch [--verbose] <command> [options]

--verbose / -v raises logging to DEBUG. Logs are JSON lines on stderr and appended to ~/.macbatch/logs/macbatch.jsonl.

setup

Bootstrap this Mac as a worker: install Ollama, pull a model, write config, ping the control plane.

bash
macbatch setup --control-url https://your-control-plane
OptionDefaultMeaning
--control-urlhttp://127.0.0.1:8000Control plane to join
--jobsembedComma-separated job types this worker accepts
--modelnomic-embed-textModel to pull
--worker-idgeneratedOverride the worker identity
--skip-ollamaoffSkip runtime install and model pull entirely
--no-installoffDo not brew install ollama; fail if it is missing

Exits non-zero if the Ollama bootstrap fails. A control plane that is unreachable produces a warning, not a failure.

control

bash
macbatch control start [--host 127.0.0.1] [--port 8000] [--tunnel] [--public]
macbatch control url
macbatch control workers
ActionDoes
startRuns the control plane on this machine
urlPrints the local URL, the public tunnel URL, and what workers will use
workersTable of registered workers with alive state and counters
OptionMeaning
--tunnelStart a Cloudflare quick tunnel and print a public URL. Needs cloudflared.
--publicBind 0.0.0.0 for LAN access. Prefer --tunnel for other networks.
--portChange the port. Use this rather than killing a healthy server.

If the port already holds a healthy macbatch control plane, start reports it and exits 0; --tunnel attaches to it instead of starting a second server.

serve

Run the worker loop.

bash
macbatch serve [--control-url URL] [--worker-id ID] [--once]
               [--lease-limit N] [--max-concurrent N]
OptionDefaultMeaning
--control-urlfrom configOverride and persist the control plane URL
--worker-idfrom configOverride the worker identity
--onceoffProcess one lease batch, then exit. Useful in scripts and CI.
--lease-limit2Shards leased per round trip
--max-concurrent2Shards processed in parallel

Writes its pid to ~/.macbatch/state/serve.pid so macbatch sleep can stop it. Any option given here is merged into the saved config.

sleep

bash
macbatch sleep

Sends SIGTERM to the recorded pid, clears the temp cache, and posts an offline heartbeat. Model weights are kept. If serve is in the foreground, Ctrl+C is equivalent.

clean

bash
macbatch clean [--yes|-y]

Clears ~/.macbatch/cache/. Prompts unless -y. Never touches Ollama models — use ollama rm <model>.

status

Prints the config path, worker id, effective control URL, public URL, job types, models, and whether serve is running, then queries the control plane for the worker list.

doctor

Preflight checks: ollama, brew, cloudflared, config file, control-plane /health, and the Ollama API. Each line is OK or FAIL with detail.

bench

bash
macbatch bench embed --n 500 --mode solo --shard-size 32
OptionDefaultMeaning
--n500Item count
--modesoloComparison label only — does not change behaviour
--modelnomic-embed-textModel
--shard-size32Items per task
--corpusJSONL path; synthetic corpus generated if omitted
--control-urlfrom configOverride the control plane

embed is the only supported workload. Fails immediately if no worker is alive. See Methodology.

corpus

bash
macbatch corpus --n 500 [--out path.jsonl]

Writes a synthetic JSONL corpus. Defaults to data/embed_<n>.jsonl in a source checkout, or ~/.macbatch/data/ when installed.

version

bash
macbatch version

MIT licensed. Every benchmark on this site is reproducible with macbatch bench.