"commandline" usually refers to a shell. And a shell is meant to run programs, not to access running programs. So, when using a shell, you'll have to use some kind of client-server architecture, similar to a ftp client, that accesses a ftp server.
"Sockets" are the basic level of interprocess-communication:
There are higher levels of message buses, like "dbus".
A very low level of communication would be using the filesystem and file-content. Commands as simple as "echo" and "cat" could be enough to access your program.
A different approach would be to simply let your program open multiple windows/terminals. This depends on your needs.