On macOS opens the parent working directory on a new window in the Finder
Make the script executable:
chmod 755 opwd
If necessary create a bin/
directory into /usr/local
...
sudo mkdir /usr/local/bin
...and add it to PATH
environment variable in ~/.zshenv
export PATH=/usr/local/bin:$PATH
Finally:
sudo cp opwd /usr/local/bin/opwd
From the terminal:
% opwd