CLI Reference

CLI Reference

Complete reference for mbr’s command-line interface.

For configuration file settings, environment variables, and feature-specific behavior tuning, see the Configuration Reference.

Usage

mbr [OPTIONS] [PATH]

If PATH is omitted, mbr uses the current directory.

PATH selects the page (or folder) to open; the repository root is discovered separately, by searching upward for a marker such as .mbr/, .git/ or .obsidian/ (see Configuration). The two are usually different, and deliberately: mbr -s docs/guide.md inside a checkout serves the whole checkout with that page open.

Hidden directories named on the command line are scanned. mbr normally skips every path component beginning with ., since those hold tooling state rather than notes. Naming one is a statement that it holds notes, so mbr -s .scratch (or mbr -b .scratch) indexes .scratch and everything under it, even though the root is the enclosing repository. The waiver covers only the directories on the path from the root down to PATH — a .git or .obsidian inside .scratch is still skipped, and so is a hidden directory elsewhere in the repo.

Mode Flags

These flags are mutually exclusive:

FlagDescription
(none)Launch GUI window (default with gui feature)
-s, --serverStart web server only (no GUI)
-g, --guiLaunch native GUI window (explicit)
-b, --buildGenerate static site
--extract-video-metadataExtract video metadata to sidecar files (requires media-metadata feature)
--extract-pdf-coverExtract cover images from PDF files (requires media-metadata feature)

Media File Arguments in GUI Mode

When a media file (video, audio, image, or PDF) is passed as the PATH argument in GUI mode, mbr automatically opens the appropriate media viewer instead of displaying the raw file. For example, mbr -g videos/demo.mp4 opens the video viewer at /.mbr/videos/?path=%2Fvideos%2Fdemo.mp4.

Supported media types are detected by file extension:

TypeExtensions
Videomp4, m4v, mov, webm, flv, mpg, mpeg, avi, 3gp, wmv, mkv, ts, mts, m2ts, vob, divx, xvid, asf, rm, rmvb, f4v, ogv
Audiomp3, wav, ogg, flac, aac, m4a, aiff, aif, oga, opus, wma
Imagejpg, jpeg, png, webp, gif, bmp, tif, tiff, svg
PDFpdf

Options

OptionDescriptionDefault
--host <HOST>Server IP address to bind. Warning: binding to a non-loopback address (e.g. 0.0.0.0) makes the entire repository readable to the network with no authentication; mbr logs a warning at startup.127.0.0.1
--output <PATH>Output directory for static buildbuild
--template-folder <PATH>Custom template folder(uses .mbr/)
--oembed-timeout-ms <MS>Timeout for URL metadata fetch (0 to disable)500 (server/GUI), 0 (build)
--oembed-cache-size <BYTES>Max oembed cache size (0 to disable). Affects link-preview metadata only — the video/PDF metadata cache is sized by the media_cache_size config option / MBR_MEDIA_CACHE_SIZE, which has no CLI flag.2097152 (2MB)
--build-concurrency <N>Files to process in parallel during buildauto (2x cores, max 32)
--skip-link-checksSkip internal link validation during buildfalse
--fail-on-broken-linksExit with a non-zero status if the static build (-b) finds broken internal links. For CI. No effect with --skip-link-checks (the build warns on stderr when both are set, since the combination disables the gate).false
--no-link-trackingDisable bidirectional link trackingfalse
--no-relationship-trackingDisable typed relationship trackingfalse
--no-tasksDisable the task browser. The /.mbr/tasks endpoint returns 404 and no task index is ever built. Server/GUI only — static builds never include tasks either way.false
--no-reviewDisable data-mbr-line source-line attributes on block elements. Server/GUI only — static builds, the CLI and QuickLook never emit them either way.false
--mark-incompleteHighlight TK/TODO/FIXME/XXX anywhere in a lineserver/GUI: on, build: off
--no-mark-incompleteDisable incomplete-marker highlightingserver/GUI: off, build: on (no effect)
--title-prefix <TEXT>Text to prepend to all page titles"" (empty)
--title-suffix <TEXT>Text to append to all page titles"" (empty)
--transcode[EXPERIMENTAL] Enable dynamic video transcoding to 720p/480p (server/GUI mode only). Not needed for automatic playback recovery, which is a stream copy and is always available.false
--editEnable the in-browser markdown editing endpoints (server/GUI mode). Loopback callers may edit without a token (still CSRF-protected); non-loopback callers require a token. See editing.false
--generate-edit-tokenPrompt for a password (blank to auto-generate a random token), print the token and the edit_token_hash config line, then exit. Writes nothing to disk.
-v, --verboseIncrease log verbositywarn level
-q, --quietSuppress output except errors
--helpPrint help message
--versionPrint version

Boolean Flag Naming Convention

mbr uses two patterns for boolean flags that disable behavior:

Verbosity Levels

FlagLevel
(none)warn
-vinfo
-vvdebug
-vvvtrace

The RUST_LOG environment variable overrides these flags.

Examples

# Launch GUI (default mode)
mbr ~/notes
mbr README.md

# Render single file to stdout (CLI mode)
mbr -o README.md
mbr -o README.md > output.html

# Start server on default port
mbr -s ~/notes

# Start server with debug logging
mbr -s -vv ~/notes

# Launch GUI window (explicit)
mbr -g ~/notes

# Open a media file in the GUI media viewer
mbr -g videos/example.mp4    # Opens video viewer
mbr -g music/song.mp3        # Opens audio player
mbr -g images/photo.jpg      # Opens image viewer
mbr -g docs/paper.pdf        # Opens PDF viewer

# Build static site
mbr -b ~/notes

# Build to custom directory
mbr -b --output ./public ~/notes

# Use custom template folder
mbr -s --template-folder ./my-theme ~/notes

# Increase oembed timeout
mbr -s --oembed-timeout-ms 2000 ~/notes

# Disable oembed fetching (uses plain links)
mbr -s --oembed-timeout-ms 0 ~/notes

# Enable in-browser editing (loopback: no token needed)
mbr -s --edit ~/notes

# Generate a hashed editing token for remote use
mbr --generate-edit-token

Media Viewer Endpoints

mbr provides dedicated viewer pages for media files. These endpoints render media content within the site’s navigation chrome (header, breadcrumbs, theme) for a consistent browsing experience.

Available Endpoints

EndpointDescription
/.mbr/videos/Video player page
/.mbr/pdfs/PDF viewer page
/.mbr/audio/Audio player page

Usage

Each endpoint accepts a path query parameter specifying the media file location (relative to repository root):

# Video viewer
http://localhost:5200/.mbr/videos/?path=/videos/demo.mp4

# PDF viewer
http://localhost:5200/.mbr/pdfs/?path=/docs/report.pdf

# Audio player
http://localhost:5200/.mbr/audio/?path=/music/track.mp3

The path parameter should be URL-encoded if it contains spaces or special characters:

# Path with spaces
http://localhost:5200/.mbr/videos/?path=/videos/My%20Video.mp4

Features

Video viewer:

PDF viewer:

Audio player:

Security

The media viewer validates all paths to prevent directory traversal attacks:

Invalid paths return an error page rather than exposing file system contents.

Static Builds

During static site generation (-b), media viewer pages are generated at:

build/
└── .mbr/
    ├── videos/
    │   └── index.html
    ├── pdfs/
    │   └── index.html
    └── audio/
        └── index.html

These pages work identically in static builds using client-side JavaScript to load and display media based on the path query parameter.

Examples

# Start server and open video viewer
mbr -s ~/notes
open "http://localhost:5200/.mbr/videos/?path=/videos/demo.mp4"

# Generate static site with media viewers
mbr -b ~/notes
# Viewer pages are at build/.mbr/videos/index.html, etc.

# Test directory traversal protection (should show error)
curl -s "http://localhost:5200/.mbr/videos/?path=/../../../etc/passwd"
# Returns error page, not file contents