If I was making an interactive command line, I think I'd want to do it all in shell. Let's say it's a CLI that interacts with a remote server, then I might have a "script" that "starts" a custom CLI by doing:
#!/usr/bin/env bash
export REMOTE_ADDR="$1"
export PATH="$(dirname $0)/commands:$PATH"
export PS1='service:\$ '
bash
Now you do something like: $ server-cli https://myservice.com
service:$ which upload
/path/to/server-cli/commands/upload
$ upload ./my-file.png
uploading.......
All you are doing here is adding all your custom commands (which are just command line applications), and starting up the CLI by giving it some context of some sort. All I have here is $REMOTE_ADDR (which by convention a command like upload would read), but you could have auth or whatever.Along with this, you get a pretty workable programming language (shell), access to the local environment, access to the "standard library" of commands you know, and so on.