cli: introduce the concept of user defined hooks