The minimum and most straightforward way to check if command exists and where the executable is.
github.com/otiai10/lookpath
otiai10/lookpath