Run consensus on multiple questions from a file.
duh batch [OPTIONS] FILE
Processes multiple questions sequentially from a file. Supports plain text (one question per line) and JSONL (one JSON object per line with a question field). The format is auto-detected.
Each question runs through the consensus (or voting) protocol independently. Results are displayed as they complete.
See Batch Mode for input format details and examples.
| Argument | Required | Description |
|---|---|---|
FILE |
Yes | Path to a text or JSONL file containing questions |
| Option | Type | Default | Description |
|---|---|---|---|
--protocol |
choice | consensus |
Default protocol: consensus, voting, or auto. JSONL entries can override per-question. |
--rounds |
int | From config (3) | Max consensus rounds |
--format |
choice | text |
Output format: text (human-readable) or json (structured) |
Basic batch run:
duh batch questions.txtJSON output for scripting:
duh batch questions.txt --format json > results.jsonUse voting protocol:
duh batch questions.txt --protocol votingFewer rounds for faster processing:
duh batch questions.txt --rounds 1Plain text -- one question per line, # comments and blank lines skipped:
What database should I use for SaaS?
# This line is a comment
REST vs GraphQL for mobile apps?
JSONL -- each line is a JSON object:
{"question": "What database should I use?"}
{"question": "REST vs GraphQL?", "protocol": "voting"}- Batch Mode -- Full guide with output examples
ask-- Run a single consensus query