Transistors are simple electronical devices. They don’t run software. You can control their inputs with another device (such a microcontroller) that does run software. You can also control their inputs with a button. You can’t control their output with software.
I don’t know how an Amazon echo is wired up, but if you just have a button connected to the gate of the transistor, it works basically the same as a mechanical switch.