Just read Miguel's blog about the debugger's command line interface.
I think it's not that hard to design a new command line interface for it and I already kept this in mind when I designed the current one. The current one basically consists of two parts: the scripting interface and the command line parser.
The scripting interface is the "heart" of it and it's not specific to any particular command line language. It basically provides Commands and Expressions which are created by the command line parser. There's also a special class, the ScriptingContext which saves user settings and also serves as a proxy to the "real" debugger classes.
So basically, we just need to write a new command line parser. I already had the idea of using reflection to do this - the "help" command, for instance, already does this.
We have, for instance:
The parser could use reflection to get all the public constructors from this class and then just call them with the appropriate arguments. In this example, it'd know that the "call" command takes a VariableExpression and a list of arguments.
A VariableExpression is basically an Expression which resolves to a variable in the target. For the parser, all that's important is that it's syntactically correct - it doesn't need to care whether such a variable exists, has the correct type etc.
This means that for instance "call $a" is syntactially correct for the parser - and the parser doesn't need to know what "$a" is. If it resolves to an int (so you can't call it), for instance, this'll be caught when the command is actually executed (resolved). It'll throw a ScriptingException - with an error message which is suitable to be displayed to the user.