How can I convert .odt to .html (or .md) from the commandline?

You're using --convert-to, but you're not specifying the value for it.

The correct syntax is:

soffice --headless --convert-to htm:HTML --outdir . my.odt

Or try to use the following script:

#! /bin/bash

CONFIG=/path/to/tidy_options.conf
# rm -rv "$2"
mkdir -p "$2"

for F in `find $1 -type f -name "*.doc" -or -name "*.odt"`; do
  BASE=`basename $F .doc` ; BASE=`basename $BASE .odt`
  soffice --headless --convert-to htm:HTML --outdir $2 $F
  tidy -q -config $CONFIG -f $2/$BASE.err -i $2/$BASE.htm | sed 's/ class="c[0-9]*"//g' > $2/$BASE.html
done

Usage:

$ convert_doc_to_html.sh SOURCE_DIR TARGET_DIR

See:

  • How to convert .doc and ODF files to clean and lean HTML at TechRepublic