I'm using OSX 15.5 and using pyenv to switch python versions. Make sure you're using python3.
First follow the OSX Setup
https://docs.espressif.com/projects/esp-idf/en/v5.5/esp32s3/get-started/linux-macos-setup.html
Assuming all that worked and you managed to build and flash to your esp32 board from the command line then add this to your ~./zshrc
export IDF_PATH="<path_to>/esp-idf"
export PATH="$IDF_PATH/tools:$PATH"
alias get_idf='. <path_to>/esp-idf/export.sh'
I copied the hello-world project in the esp-idf/examples/getting-started then opened it in CLion and then followed along with this youtube video, but swapping out the Windows stuff for terminal.
Developing for ESP32 With CLion on Windows
The gist of that video is to open a terminal window, run get_idf and then run echo $PATH and then copy the new parts that the script added.
Then open Settings > Build, Execution, Development > CMake and click the little icon on the right hand end of the Environment field and scroll down the system environment variables list in the lower half of the window and click to edit the PATH to add the new bits that you just copied to the beginning of the path. Make sure you copy the last :.
Additionally I had to set the ESP_ROM_ELF_DIR envvironment variable in the Settings > Build, Execution, Development > CMake window in CLion by clicking the little + in the User environment variables section at the top
Mine was ~/.espressif/tools/esp-rom-elfs/20241011/ but yours may differ.