If you're using Visual Studio Code on macOS and encounter the "command not found: code" error, follow these steps to enable this feature.
Launch Visual Studio Code on your computer.
Cmd + Shift + P
to open the Command Palette.After installation, open Terminal and type:
code --version
If you see a version number, the command has been successfully installed.
You can now use the code
command from Terminal to easily open Visual Studio Code!