Slowly realising that making a decent command palette is both challenging and rewarding.
The first intuition is to define some rigid structure: commands, nested commands, maybe a param system, async item fetching, flexible/fuzzy search.
for which app are you building one? I just started for herocast and went through exactly the points you mentioned