How to convert document from command line?

Using Linux. I need to extract plain text from thousands of .odt documents. I would like to, for example, setup a simple script at the CLI to open the .odt files one at a time, select the 'save as text" format conversion, and then save the text file with the same root name as the original file.

Essentially in the CLI:
a) Open file xyz.odt
b) save as xyz.txt

In other words, I need to automate what can be done using the standard “save as” feature in the Writer module.

But I cannot find any mention of being able to do this from the CLI, if it can be done at all.

Can it :question:

Thanks,

Monty

soffice --convert-to txt --outdir /path/to/write/to filenames*.odt

Or take a look at GitHub - unoconv/unoserver.

Thanks! I did try unoconv, but it would not work. Then found unoconverter (unoconvert) and it worked great.