Revert "Change the way we detect existing commands"

This reverts commit e157b5fd1e1bbe1749b2440487d3b7995592f356.