This is basically exactly what Emacs does--every single GUI action, be it a keyboard shortcut, a menu item, a mouse click or even a touch gesture[1] maps directly and very unsubtly to an elisp function. This means you can go from just using Emacs like a normal text editor do doing really complicated things with elisp in a relatively straightforward way.
Coincidentally, I don't see how Emacs is a CLI program, even if it does have a text-only mode: the text-only mode just draws the GUI elements with text the way other programs draw them with pixels. Of course, it's a tool heavily optimized for power users, but that's a different story.
[1]: https://github.com/greboide/emacs-gestures
Coincidentally, I don't see how Emacs is a CLI program, even if it does have a text-only mode: the text-only mode just draws the GUI elements with text the way other programs draw them with pixels. Of course, it's a tool heavily optimized for power users, but that's a different story.