Help needed: how to write a macOS shell script to batch import .enex files

Ouch. You are using the desktop profile with the cli app. Please be careful. This is not supported.

The official way to do that is to sync the cli to a sync target and then sync that sync target with a new profile on the desktop app.