CLI Reference Overview
bwa-mem3 exposes four subcommands: index, mem, shm, and version. Run
bwa-mem3 <subcommand> --help to see the full option list for any command.
How this section is structured
Each subcommand page follows the same layout:
- Introduction — what the subcommand does and when to reach for it.
- Synopsis — the verbatim
--helpoutput, auto-captured from the binary at build time and included here via mdbook’s{{#include}}directive. The snippet is regenerated bymake docs-cliand CI fails if it drifts from the binary. - Common usage — two or three worked command-line examples.
- Flag reference (for
mem, grouped by topic) — per-flag prose covering semantics, defaults, and interaction with other flags that the--helptext does not have room to explain. - Notes / Gotchas — operational warnings about non-obvious behavior.
- See also — cross-links to related pages in this book.
Subcommands
index builds the FM-index from a reference FASTA.
Pass --meth to produce a bwameth-style doubled c2t reference for
methylation alignment.
mem aligns short reads against an indexed reference, producing
SAM or BAM output. It is the primary alignment subcommand. The flag surface is
large; the mem reference page groups flags by purpose to make them easier to
navigate.
shm stages an FM-index into POSIX shared memory so that
repeated bwa-mem3 mem invocations on the same machine skip the per-run disk
read. It also lists and destroys staged segments.
version prints the bwa-mem3 release version and, when mimalloc is compiled in, the mimalloc version.
See also: User Guide — Aligning short reads · User Guide — Indexing the reference · Getting Started — Quick start: align paired-end FASTQs · Getting Started — Quick start: shared-memory index · Performance — Tuning checklist