For information, this has now been implemented in this commit so it will be part of the next CLI release.
For now it works like so:
joplin batch /path/to/commands.txt
And "commands.txt" should contain a list of commands, one per line. For example:
config locale fr_FR
mkbook "some notebook"
use "some notebook"
mknote "some note"