StratusLab / client

Command Line Interface (CLI) for StratusLab cloud services
Apache License 2.0
2 stars 1 forks source link

command wrapper and interactive shell #136

Closed loomis closed 5 years ago

loomis commented 10 years ago

While playing around with StratusLab with Florent, we found it handy to have a single entry point wrapper script for managing our virtual machines. The little proof of concept sets up the environment and delegates the work to the various stratus-* user commands, a bit like for git or other tools with many subsystems. With an alias sl -> stratuslab, the user interface becomes:

    sl list
    sl run ...
    sl connect <id>
    sl shutdown <id>
    sl kill <id>
    sl shell                   # runs a shell with the environment variable set appropriately

As goody, one can specify the vm name as id.

It's nowhere near prime time (documentation, configuration, option parsing, wrap all other user commands, ...). But feel free to experiment and see how it feels in practice, improve, send pull requests, whatever ... And if at the end of the day there are more than the two of us to find it handy, maybe a production version could be made out of it.

It would be cool too to implement and share appropriate shell completion configuration.

loomis commented 10 years ago

Probably if the intention is to move towards providing full command completion, interactive shell, etc. then a framework for doing this like cliff would be appropriate.

loomis commented 10 years ago

The StratusLab/cimi-client-py (an example client for the CIMI interface that's being developed) takes a similar approach but uses the python shell itself. Probably converging on a common frameworks/techniques would allow for eventual convergence between these activities.

nthiery commented 10 years ago

Thanks for the suggestions!

At this point, I am not sure about having a specific interactive shell: the current script only provides it to make it easy to run the commands that have not yet been wrapped. I guess I'd rather stick to my favorite shell, and use the completion features there (like when I use git/...).

loomis commented 10 years ago

Another framework option is click pointed out by Sebastian at SixSq who's going through a similar reflection for the CLI for SlipStream.