Experimenting with using darktable-cli to export a raw image to jxl format, I discovered that the generated *.jxl file does not contain any metadata (exif, xmp, iptc or proprietary). So far, I exported to *.png without such problems.
I noticed a bug (JXL export: Missing metadata · Issue #15388 · darktable-org/darktable · GitHub) concerning export function with darktable-gui. There the recommendation is to activate all check boxes in the export settings, which leads to jxl files containing metadata indeed.
But for darktable-cli I didn’t find any similar options concerning metadata. Here is the link to documentation (see end of page): darktable 4.8 user manual - darktable-cli
Has anyone an idea?