Manage the GPIO port, with a button and an output pulse.

Hi to all, I’m new to the community. I’m starting to try my hand with hassio, I’m doing tests with my raspberry, I need to use only the GPIO port, in practice I have to send an output pulse of one second to command relays, and then have a bolean variable that switch when I send the impulse or when I use an external button (always connected to the GPIO port), can you give me a hand with the code? Where can I find all hassio commands? Thanks a lot to everyone