To regenerate the “open with” context menu in macOS (and reopen Finder windows), execute the following two commands in Terminal:
$ /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
$ killall Finder