Create stateful cover that calls a shell command

I have a shell command to open a window, but I’d like to be able to expose it to Alexa so,I can say ‘Alexa, open the window’. I’m really unclear on how to do this as I don’t want to use a switch because I’d have to use on and off as commands - I really want to use open and close.