step 1 : Add Intellij to your root path
I am assuming you have IntelliJ IDEA Community Edition
echo 'export PATH="/Applications/IntelliJ IDEA CE.app/Contents/MacOS:$PATH"' >> ~/.zshrc
Step 2 : Reload your shell by using 👇
source ~/.zshrc
Step 3 : Verify path by using 👇
which idea
it should be show something like this "/Applications/IntelliJ IDEA CE.app/Contents/MacOS/idea"
Step 4 : Open a project by moving to the directory and hit 👇
idea . (open current folder)
Note: All command are in bold