How to access commands in command palette with registerEvent

Ser answer below: