Short answer is yes, CLI can be enabled/used on FTD or MTD builds.
OpenThread is a networking library which provides public APIs and then need to be linked with an app layer code (using the APIs to control the network) along with a platform layer code to form the device firmware. The CLI is an example app layer code which is provided in OpenThread repo and can be integrated into a product firmware. Whether/how it is integrated and is used is up to app layer code (project/products integrator).
How the device performs commissioning is again up to app layer code and what UX flow makes sense for the device. Some examples below:
- App code on a battery powered device may check if it is not already commissioned and then try to `otJoinerStart()` upon boot (and monitor the join success/failure and handle however many retries if/when needed)
- Other behaviors may be added based on device HW capability and intended UX, e.g. if there is a button on device, app layer code may be written to retry joining upon user pressing the button, etc.
- If there is an out-of-band (not Thread) mechanism to connect to the joining device , it may be used to trigger and control the Thread commissioning process, e.g., if device has BLE, a vendor/product specific protocol/mechasnim may be used to establish a connection from a mobile phone to the new device (using BLE) and then trigger and control it for joining to the Thread network (and in general setting up and configuring of the device).
Hope this helps,
Abtin.