Controlling iOS apps via command line
You can install OpenSSH in Cydia and use a SSH client (say, Panic's Prompt - look for it in the App Store), that makes a pretty nice terminal emulator for iOS.

As to running programs from the command line, sure, no problem, but none of them are designed to work in CLI. They don't retrieve/parse arguments, don't output...etc 
If you can get some out of Cydia or compile them yourself, it'll work, but I don't think you'll be able to command Apple's own apps that way.