Some time in the late '90s a friend and i sat down and tried to design a UI framework that could cover lots of styles. We started with GUI and line-mode terminal, but hoped to add curses and the web (1.0 of course, so using forms, not JavaScript). I didn't know about block-mode terminals at the time.
GUIs and line-mode terminals are radically different, so you have to think of a language of UI primitives that are high-level enough to have a natural implementation in each style.
This is hard! For starters, a GUI is inherently spatial, whereas a command line is more temporal. If you want to specify a sandwich, say, then in a GUI, you might have three select boxes next to each other for the bread, filling, and dressing, and a submit button, whereas on a command line, you need to prompt three times, and perhaps offer options for going back and changing the selection. Or offer internal commands for viewing the lists and making a selection, for a more shell-like interface.
From what i remember, our API ended up looking a lot like web forms - the application presents a series of questions, each with a prompt and a structure for the answer (free text, select one from a list, etc). The GUI implementation then put together a (very ugly) GUI with a elements for each question, the command line implementation asked each question in turn.
We never got as far as trying to display rich information. That could have been a whole different set of problems.