CLI Reference
August 7, 2026 · View on GitHub
What you will find here
Command reference for python3 -m bnnr aligned to src/bnnr/cli.py.
When to use this page
Use this for no-code workflows: training, report reading, dashboard replay/export.
Entry point
python3 -m bnnr --help
demo
python3 -m bnnr demo
Zero-config onboarding run — no flags, no YAML.
- Downloads CIFAR-10 automatically on first use.
- Trains a small demo CNN (not ResNet-18) with preset
demo(saliency-guided ICD + ChurchNoise). - Sample limits: 128 train / 64 val;
m_epochs=1,max_iterations=1, XAI enabled. - Starts the live dashboard and opens it in your browser (same as
--with-dashboardontrain). - Writes artifacts under
reports/andcheckpoints/; after training (before the dashboard wait loop) prints paths to the JSON report andreports/<run>/artifacts/xai/heatmaps when present.
For an interactive wizard with prompts, use quickstart instead.
quickstart
python3 -m bnnr quickstart [OPTIONS]
Interactive zero-config demo: prompts for dataset, preset, and dashboard, then runs training with built-in defaults and sample limits (128 train / 64 val).
Options: --dashboard-port, --no-auto-open.
train
python3 -m bnnr train [OPTIONS]
Run BNNR augmentation search training.
Options
--config -cPATH (optional YAML config. Omit for built-in quickstart defaults)--datasetTEXT (dataset:mnist,fashion_mnist,cifar10,stl10,imagefolder,coco_mini,yolo) [default: cifar10]--data-dirPATH (directory for dataset download/storage) [default: data]--data-pathPATH (custom data path (required for theimagefolder/coco_mini/yolo))--output -oPATH (output directory for checkpoints and reports)--device -dTEXT (device:cuda,cpu,auto)--epochs -eINTEGER (number of epochs per candidate)--seed -sINTEGER (random seed)--no-xai(disable XAI generation)--augmentation-preset, --presetTEXT (augmentation preset:auto,light,standard,aggressive,gpu,icd,none; unknown names fall back toautowith a warning).icd= saliency-guided ICD + AICD candidates (model/target layers supplied by the pipeline) [default: auto]--with-dashboard / --without-dashboard(enable dashboard: starts server, logs events, opens browser) [default: with-dashboard]--dashboard-portINTEGER (dashboard server port; if busy, the dashboard auto-falls back to the next free port inport..port+9and prints the actual port) [default: 8080]--no-auto-open(don't auto-open browser when dashboard starts)--tokenTEXT (token to protect dashboard control endpoints (pause/resume). Also configurable viaBNNR_DASHBOARD_TOKENenv var)--batch-sizeINTEGER (training batch size) [default: 64]--max-train-samplesINTEGER (limit training samples)--max-val-samplesINTEGER (limit validation samples)--num-classesINTEGER (number of classes (forimagefolder))--dry-run(build the pipeline, print the summary + config warnings, then exit without training)--help(show this message and exit)
Supported datasets
Classification (built-in single-label demos):
mnist,fashion_mnist,cifar10,stl10,imagefolder
Object detection (requires task: detection in your YAML and a matching config; see detection.md):
coco_mini— COCO-style layout under--data-path(train2017/val2017ortrain/val, plusannotations/).yolo— Ultralytics-style--data-pathpointing atdata.yamlor its parent directory.
Multi-label classification
bnnr train with mnist, fashion_mnist, cifar10, stl10, or imagefolder always builds single-label pipelines (CrossEntropyLoss, one class index per sample). Setting task: multilabel in your config YAML does not change that behavior. For multi-label, use the Python API (golden_path.md) or the scripts under examples/multilabel/ (examples.md).
Behavior notes
--with-dashboard(default): starts live dashboard server and keeps process alive.--without-dashboard: no live server; good for one-shot runs.- CLI keeps event logging enabled so
dashboard exportworks after training.
Examples
# Zero-config quickstart (built-in defaults)
python3 -m bnnr train --dataset cifar10 --preset light --with-dashboard
# Custom YAML config
python3 -m bnnr train \
-c examples/configs/classification/mnist_example.yaml \
--dataset mnist \
--max-train-samples 1000 \
-e 2
# CIFAR-10 with GPU augmentations
python3 -m bnnr train \
-c examples/configs/classification/cifar10_example.yaml \
--dataset cifar10 \
--preset gpu \
--device cuda
analyze
python3 -m bnnr analyze [OPTIONS]
Run model analysis: metrics, XAI, data quality, failure patterns, recommendations.
On Windows terminals with encoding issues, set PYTHONUTF8=1 and PYTHONIOENCODING=utf-8 before running bnnr analyze.
See analyze.md for details and examples.
Arguments (required)
--model -mPATH (path to model checkpoint (.pt) or state dict)--dataPATH (path to data directory (ImageFolder) or dataset name (e.g.mnist,cifar10))--output -oPATH (output directory foranalysis_report.jsonandreport.html)
Options
--task -tTEXT (task: classification or multilabel only (detection is not supported by analyze yet)) [default: classification]--config -cPATH (optional YAML config (overrides defaults))--max-worstINTEGER (number of worst predictions to include) [default: 20]--no-xai(disable XAI analysis)--no-data-quality(disable data quality checks)--device -dTEXT (device: cuda, cpu, auto)--batch-sizeINTEGER (batch size for evaluation) [default: 64]--summary/--no-summary(print executive summary and top findings/recommendations to stdout) [default: summary]--cv-foldsINTEGER (optional number of folds for lightweight cross-validation (0 to disable)) [default: 0]--xai-samplesINTEGER (number of samples for XAI probe set (more = more accurate, slower)) [default: 500]--help(show this message and exit)
report
python3 -m bnnr report [OPTIONS]
View or export a BNNR training report.
Arguments (required)
report_pathPATH
Options
--format -fTEXT (output format:summary,json) [default: summary]--output -oPATH--help(show this message and exit)
Dashboard commands
python3 -m bnnr dashboard serve --run-dir reports --port 8080
python3 -m bnnr dashboard export --run-dir reports/run_YYYYMMDD_HHMMSS --output exported_dashboard
dashboard serve options:
--run-dir--port--frontend-dist--token(or envBNNR_DASHBOARD_TOKEN)
dashboard export options:
--run-dir(required)--output(required)--frontend-dist
Dashboard usage notes (important)
dashboard serveprints both Local URL and Network URL plus terminal QR code.- Open Local URL on desktop first, then use QR from phone on the same network.
- For secured controls, use
--token(orBNNR_DASHBOARD_TOKEN). - For production workflow details (pause/resume, mobile access, export), see
dashboard.md.
Utility commands
python3 -m bnnr list-augmentations
python3 -m bnnr list-augmentations --verbose
python3 -m bnnr list-presets
python3 -m bnnr list-datasets
python3 -m bnnr version