stratos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milindu Sanoj Kumarage <agentmili...@gmail.com>
Subject Re: GSoC 2015
Date Wed, 25 Mar 2015 18:35:19 GMT
Hi Imesh,

Here I have uploaded  a simple CLI demo to Pip, you can install it with
giving this command if you have Pip on your system.

$ sudo pip install stratos

then can invoke it simply calling it on CLI as,

$ stratos


What I'm trying to demonstrate with this demo is the basic functionalists
of the CLI, like autocomplete option, help options, input/ output
redirection, etc. And ability to consume RESTful services via HTTP,
authenticating with HTTP Basic authentication. And also my ability to
create Python distributions.

I'm using Github's API currently in order to demonstrate the ability to
make requests to API and get responses. Connecting to Github API with HTTP
Basic authentication.


*In the Interactive mode*

   1. Give the 'user' command as follows. You will see your name and email
   retrieved from the Github API.

   user -u <github-username> -p <github-password>

   2. Type 're' and press Tab, it will complete the command.
   3. Type 'de' and press Tab, then the command will be completed up to
   'deploy-' then press Tab twice. It will show the possible commands.
   4. Type 'de' and press Tab, then the command will be completed up to
   'deploy-' then type 'u' and press Tab , it will complete the command.
   5. Type '?repositories' or 'help repositories' , this will show the help
   options for 'repositories' command.
   6. Give the 'repositories' command as follows. You will see 5 of your
   Github repositories in tabular format, retrieved from the Github API.

   repositories -u <github-username> -p <github-password>

   +----------------------+------------+
   |         Name         |  language  |
   +======================+============+
   | backbone-boilerplate | JavaScript |
   | CRUD.js              |        CSS |
   | DeciesGraph          |        CSS |
   | fancyBox             | JavaScript |
   | html5-boilerplate    | JavaScript |
   +----------------------+------------+

   7. press up arrow key, you will the the last command issues, you can
   traverse through the history using up and down arrow keys.
   8. Try history command, Try list command.
   9. Try giving a shell command, it will work in the same way the bash
   works.

   !ls

   or

   shell ls

*In the single command mode*

   1. Issues the commands in the same way as in interactive mode.

   $ repositories -u <github-username> -p <github-password>

   2. Issues this command in command line. It will write the output to a
   file names 'out.txt'.

   stratos repositories -u <github-username> -p <github-password> > out.txt

   3. Issues this command in command line. It will pipe the output to the
   grep command.

   stratos repositories -u <github-username> -p <github-password> |  grep
   JavaScript

   4. Create a file with some commands, entered line by line, save it as
   commands.txt, then give this command while in CMD. It will execute the
   commands line by line and print the output to the console.

   stratos < commands.txt

   5. Create a file with some commands, entered line by line, save it as
   commands.txt, then give this command while in CMD. It will execute the
   commands line by line and print the output to out.txt file.

   stratos < commands.txt > out.txt



   ( I developed and tested  this on Linux with Python 2.7 version )

Mime
View raw message