Add function for hooking into commands.