Simple Interactive Shell

## Launch interactive shell

```
tomaskorcak@kx-mac:~/dev/gooddata-ruby$ gooddata shell
> 

```

## Basic usage (just press enter in shell)

```
> 
Type 'help' for usage info
Type '(q)uit', or 'e(x)it' for quit
> 

```

## Show help

```
> help
NAME
    gooddata - GoodData Ruby gem - a wrapper over GoodData API and several useful abstractions to make your everyday usage of GoodData easier.

SYNOPSIS
    gooddata [global options] command [command options] [arguments...]

VERSION
    0.6.0

GLOBAL OPTIONS
    -P, --password=gooddata-password       - GoodData password (default: none)
    -U, --username, --login=gooddata-login - GoodData user name (default: none)
    --help                                 - Show this message
    -l, --[no-]logger                      - Http logger on stdout
    -p, --project_id=project-id            - Project pid (default: none)
    -s, --server=server                    - Server (default: none)
    -t, --token=token                      - Token for project creation (default: none)
    -v, --[no-]verbose                     - Verbose mode
    --version                              - Display the program version
    -w, --webdav_server=web dav server     - WEBDAV Server. Used for uploads of files (default: none)

COMMANDS
    api      - Some basic API stuff directly from CLI
    auth     - Work with your locally stored credentials
    console  - Interactive session with gooddata sdk loaded
    help     - Shows a list of commands or help for one command
    process  - Work with deployed processes
    profile  - Describe add here
    project  - Manage your projects
    run_ruby - Run ruby bricks either locally or remotely deployed on our server
    scaffold - Scaffold things
    shell    - Interactive Shell
0
> 

```

## List projects

```
> project list
/gdc/projects/la84vcyhrq8jwbu4wpipw66q2sqeb923,GoodSales Demo
/gdc/projects/pouwty5dezpuib8nil16fv4i1jz80oju,GoodSample Demo
/gdc/projects/tk6192gsnav58crp6o1ahsmtuniq8khb,Training March
0
> 
```

## Process list (project specific, using -p option)
```
tomaskorcak@kx-mac:~/dev/gooddata-ruby$ gooddata -p tk6192gsnav58crp6o1ahsmtuniq8khb shell
> process list
{"processes"=>
  {"items"=>
    [{"process"=>
       {"type"=>"GRAPH",
        "name"=>"Training March",
        "graphs"=>["Training March/graph/graph.grf"],
        "executables"=>["Training March/graph/graph.grf"],
        "links"=>
         {"self"=>
           "/gdc/projects/tk6192gsnav58crp6o1ahsmtuniq8khb/dataload/processes/f12975d2-5958-4248-9c3d-4c8f2e1f067d",
          "executions"=>
           "/gdc/projects/tk6192gsnav58crp6o1ahsmtuniq8khb/dataload/processes/f12975d2-5958-4248-9c3d-4c8f2e1f067d/executions",
          "source"=>
           "/gdc/projects/tk6192gsnav58crp6o1ahsmtuniq8khb/dataload/processes/f12975d2-5958-4248-9c3d-4c8f2e1f067d/source"}}}],
   "links"=>
    {"self"=>
      "/gdc/projects/tk6192gsnav58crp6o1ahsmtuniq8khb/dataload/processes"}}}
0
> 

```

## Code completion - global

You can use tabulator for completing your commands.

```
tomaskorcak@kx-mac:~/dev/gooddata-ruby$ gooddata shell
> 
api       auth      console   help      process   profile   project   run_ruby  scaffold  
> pro
process  profile  project  
> pro

```

## Code completion - subcommand

Completion properly autocompletes subcommands.

```
tomaskorcak@kx-mac:~/dev/gooddata-ruby$ gooddata shell
> process 
process deploy  process get     process list    
> process 
> project 
project build    project clone    project create   project delete   project jack_in  project list     project show     project update   
> project 

```

## Interactive commands from file

```
tomaskorcak@kx-mac:~/dev/gooddata-ruby$ cat input.txt 
project list
api info
api get /gdc
exit

tomaskorcak@kx-mac:~/dev/gooddata-ruby$ gooddata shell < input.txt 
> project list
/gdc/projects/la84vcyhrq8jwbu4wpipw66q2sqeb923,GoodSales Demo
/gdc/projects/pouwty5dezpuib8nil16fv4i1jz80oju,GoodSample Demo
/gdc/projects/tk6192gsnav58crp6o1ahsmtuniq8khb,Training March
0
> api info
GoodData API
  Version: N/A
  Released: N/A
  For more info see N/A
nil
0
> api get /gdc
{"about"=>
  {"summary"=>"Use links to navigate the services.",
   "category"=>"GoodData API root",
   "links"=>
    [{"link"=>"/gdc/", "summary"=>"", "category"=>"home", "title"=>"home"},
     {"link"=>"/gdc/account/token",
      "summary"=>"Temporary token generator.",
      "category"=>"token",
      "title"=>"token"},
     {"link"=>"/gdc/account/login",
      "summary"=>"Authentication service.",
      "category"=>"login",
      "title"=>"login"},
     {"link"=>"/gdc/md",
      "summary"=>"Metadata resources.",
      "category"=>"md",
      "title"=>"metadata"},
     {"link"=>"/gdc/xtab2",
      "summary"=>"Report execution resource.",
      "category"=>"xtab",
      "title"=>"xtab"},
     {"link"=>"/gdc/availableelements",
      "summary"=>
       "Resource used to determine valid attribute values in the context of a report.",
      "category"=>"availablelements",
      "title"=>"AvailableElements"},
     {"link"=>"/gdc/exporter",
      "summary"=>"Report exporting resource.",
      "category"=>"report-exporter",
      "title"=>"exporter"},
     {"link"=>"/gdc/account",
      "summary"=>"Resource for logged in account manipulation.",
      "category"=>"account",
      "title"=>"account"},
     {"link"=>"/gdc/projects",
      "summary"=>"Resource for user and project management.",
      "category"=>"projects",
      "title"=>"projects"},
     {"link"=>"/gdc/tool",
      "summary"=>"Miscellaneous resources.",
      "category"=>"tool",
      "title"=>"tool"},
     {"link"=>"/gdc/templates",
      "summary"=>"Template resource - for internal use only.",
      "category"=>"templates",
      "title"=>"templates"},
     {"link"=>"/gdc/releaseInfo",
      "summary"=>"Release information.",
      "category"=>"releaseInfo",
      "title"=>"releaseInfo"},
     {"link"=>"https://secure-di.gooddata.com/uploads",
      "summary"=>"User data staging area.",
      "category"=>"uploads",
      "title"=>"user-uploads"}]}}
0
> exit
tomaskorcak@kx-mac:~/dev/gooddata-ruby$ 
```