Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

CLI Reference

niobium [options] <input> <output>

Run niobium -h to see the built-in help text.

Input (mutually exclusive, one required)

FlagShortDescription
--image PATH-iAbsolute path to a single image file
--directory PATH-dirDirectory containing multiple images
--single-pdf PATH-pinAbsolute path to a PDF file

Output (mutually exclusive)

FlagShortDescription
--deck-name NAME-deckAnki deck to push notes into (requires AnkiConnect)
--pdf-img-out PATH-poutDirectory to save images extracted from a PDF
--apkg-out [PATH]-apkgDirectory to write the exported .apkg file

When no output flag is given, or -apkg is used without a path, Niobium defaults to {work_dir}/outputs (see work_dir config). If work_dir is not set either, an error is raised.

Options

FlagShortDefaultDescription
--smart:FalseEnable Claude AI — filters OCR results by default, generates cards from scratch with --generate or --page
--generate-genFalseGeneration-first mode: Claude sees the full image and generates cards from scratch (requires --smart)
--page RANGE:NonePage or page range for PDF input, e.g. 5 or 5-10 (requires -pin)
--max-cards N:NoneMax cards to generate per item (requires --smart with --page or --generate)
--card-type TYPE:NoneForce card type: cloze, basic, or image_occlusion (requires --smart with --page or --generate)
--add-header-hdrFalseAdd the filename as a card header
--basic-type-basicFalseCreate basic front/back cards instead of image occlusion
--no-cache:FalseSkip the cache for this run (does not clear existing cache)
--config PATH-cautoPath to a custom config file

Config management

These flags run their action and exit immediately — they do not process images.

FlagDescription
--init-configCopy the default config to ~/.config/niobium/config.yaml
--edit-configOpen the config directory in the system file manager
--clear-cacheDelete all entries from the SQLite processing cache and exit

Config-managed flags (advanced)

These flags are accepted by the CLI but hidden from --help because they are easier to set persistently in your config file. They can always be passed on the command line to override the config for a single run.

FlagShortConfig keyDescription
--merge-rects-mmerge.enabledMerge nearby OCR bounding boxes
--merge-lim-x N-mxmerge.limit_xHorizontal merge threshold (pixels)
--merge-lim-y N-mymerge.limit_yVertical merge threshold (pixels)
--langs LANGS-llangsComma-separated OCR language codes
--gpu N-ggpuGPU index (-1 for CPU)

Smart mode behavior

--smart behaves differently depending on the input and flags:

Input + flagsBehaviorCard types
-i or -dir with --smartSmart Filtering — OCR runs first, Claude filters regionsImage occlusion only
-i or -dir with --smart --generateSmart Generation — Claude sees the full image and generates cards from scratchImage occlusion, cloze, basic
-pin with --smart (no --page)Smart Filtering applied to images extracted from the PDFImage occlusion only
-pin --page with --smartSmart Generation — Claude sees the full page and generates cards from scratchImage occlusion, cloze, basic

When --smart is used, Niobium displays a summary panel showing the pipeline, input, output, model, and instructions before processing. This lets you verify the configuration before spending API credits.

Constraint rules