How to open path directly in apps on macOS

Intellij IDEA

https://www.jetbrains.com/help/idea/working-with-the-ide-features-from-command-line.html#toolbox

$ sudo vi /usr/local/bin/idea
$ sudo chmod +x /usr/local/bin/idea
#!/bin/sh

open -na "IntelliJ IDEA.app" --args "$@"

Visual Studio Code

https://code.visualstudio.com/docs/setup/mac

cat << EOF >> ~/.bash_profile
# Add Visual Studio Code (code)
export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
EOF
cat << EOF >> ~/.zprofile
# Add Visual Studio Code (code)
export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
EOF