You'll probably want a wrapper
Something that reads the console as it happens, and then executes commands based on it. Which means hosting the server yourself, and not using a GSP. Your best bet is probably getting into contact with a more experienced server admin with a ready to go wrapper, or build one yourself.