Skip to content

Configuration

Three settings can be configured: the edition, the cache directory and the database path. Each is taken from the first of these that sets it:

command-line option > environment variable > YAML profile > default
Setting Option Environment variable Profile field Default
Edition --edition DICOM_KB_EDITION edition Newest edition in the cache
Cache --cache-dir DICOM_KB_CACHE_DIR artifact_dir ~/.cache/dicom-standard-kb
Database --db DICOM_KB_DATABASE_URL database_url <cache>/db/<edition>.sqlite

The default edition is the newest built database for query commands and mcp serve, and the newest fetched edition for build. When --db points at an existing file, the default edition is the one that file holds.

Pass a profile with the root --config option, before the command:

Terminal window
dicom-kb --config ./dicom-kb.yaml element Modality
dicom-kb.yaml
dicom_kb:
edition: 2026d
artifact_dir: /data/dicom-standard-kb
database_url: sqlite:////data/dicom-standard-kb/db/2026d.sqlite

All three fields are optional. Unknown fields, a missing dicom_kb mapping and invalid YAML are rejected.

DICOM_KB_DATABASE_URL and database_url take a local sqlite:/// URL. An absolute path has four slashes: sqlite:////data/kb/2026d.sqlite. Other schemes and URLs with a host are rejected. --db takes a plain path.

<cache>/
artifacts/<edition>/manifest.json
artifacts/<edition>/raw/source/docbook/partNN/partNN.xml
db/<edition>.sqlite
db/<edition>.gaps.txt

The manifest records each part’s source URL, size and SHA-256. Keep several editions side by side by building each one; pass --edition to choose.