I don't know if quit already exists in the library, but I have a command do_quit that just exits out of the command line.
And then I use shortcuts to shortcut q -> quit and exit -> quit.
However, doing this results in this error:
ValueError: Invalid command name 'quit': cannot start with a shortcut: @@, ?, !, @, q