Add support for command-based hooks in addition to event hooks