Inspecting data from the shell!

Would it be very hard to inspect original data from the shell. Let me give example :

> /show intent greet

#pipe is grep
> /show i greet | he

#!  greps the story name i.e. matches "happy path"
>/show story !happy 
* greet
  - utter_greet

#show story ..
>/s s sad

>/s utter !bye

#and now for the most important ...resolving some stuff
>?show story !happy
* hello
  - Hey! how are you?
* fine
  - Great, carry on !

you get the gist …

Interesting idea! What exactly would be the use case for that? Can’t you always take a look at the data itself?

you don’t leave the shell. when the files become big it is harder to find what you are looking for. you dont need to think which file to look for.

I may be willing to write a class that does the grepping … if it is easier to integrate it in thee shell

@tyd @Tobias_Wochinger What do you think?

you don’t leave the shell. when the files become big

would you also want to edit in the shell right away or just view it?

just view it … it will need retraining anyway if you change it ! will there be benefit of editing ?

should I create a standalone sample class that provides an example API … i.e. you can just integrate it into the shell !!! just wondering

here is quick example : (I’m slurping the files into arrays) (2.3 KB)

In [72]:  from shell_cmds import *

In [73]: c = ShellCmds('','','../domain.yml')

In [74]: print c.find_utter('example')
(63, '  utter_example:\n')

In [75]: print c.show_utter('example')
  - text: "example : {etype}"

In [80]: print c.show_story('code example')
## code example
* example
 - action_example
* explain
 - utter_explain
* gotit
 - utter_gotit

In [78]: print c.show_story('code example', resolve=True)
## code example
* example
 - action_example
* explain
 - "explain : {etype}" 
* gotit
 - "gotit : {etype}"

In [79]: print c.show_intent('example')
## intent: example
- [assign](etype) example
- [sum](etype) example
- [multiplication](etype) example
- [conditional](etype)
- [loop](etype) example
- [eqvseq2](etype) example
- show me [assignment](etype:assign) example
- can you tell me [loop](etype) example
- do you have [sum](etype) code example
- i'm looking for code example of [assignment](etype:assign)

In [81]: c.grep('domain', 'howdy')
Out[81]: [[34, '  - text: howdy !\n']]

In [83]: print c.show_intent('greet')
## intent:greet
- hey
- hello
- hi
- good morning
- good evening
- hey there
- howdy

In [84]: print c.show_intent('greet', 'h')
- hey
- hello
- hi
- hey there
- howdy

Looks great! Can you please create a feature request on GitHub ( Thanks. Please link this thread. Feel also free to work on the feature itself and create a PR.