It is as simple as issuing
nmcli dev wifi hotspot ssid MyHotSpot password "test1234"
Actually ysdx in the answer given on Unix & Linux Stack Exchange added the interface name (for example ifname wlp4s0
) but when you have only one wifi interface it is not necessary: nmcli is smart enough to know which interface to use