If you're using WebStorm 2024.2+ without JetBrains Toolbox, it won't install command-line launcher automatically. Though, there's a menu "Tools > Create Command-line Launcher" that won't do anything useful, except showing you a link on how to do that, but it's bugged for now.
chmod +x /usr/local/bin/webstorm
#!/bin/sh
open -na "WebStorm.app" --args "$@" > /dev/null 2>&1 &
This would allow you to open any project in command-line, and type webstorm .
, to open WebStorm in a current directory, without any errors.