Add new menu item/edit the function of an existing one to run a command

As the title states, I want to either edit the function of an existing main menu item or add a new one (or maybe 2) that run a specified command. I know this CAN be done but can’t find the documentation, anyone have any help?

Thanks