Jarvis icon indicating copy to clipboard operation
Jarvis copied to clipboard

new features: random command, autocomplete

Open williamwu062 opened this issue 4 years ago • 7 comments

Hi, just thought of some ideas for this Jarvis project. I noticed that without looking at the plugins, it can be somewhat hard to find something for Jarvis to do without erroring, so I thought maybe we could type 'random' and have a random command pop up. Another idea I got is for us to just have tab autocomplete for the commands.

williamwu062 avatar Jun 30 '21 03:06 williamwu062

Yeah, this would be pretty cool. I was also thinking about some unifying scripts, like one for conversions that basically calls other plugins when some keyword/string is detected. Should be easy enough to call other plugins, but I wonder if there would be some way to do it without hardcoding the specific names of the plugins.. Some way to have jarvis search his own capabilities would be nice (maybe by searching through the .py files or something, though this might require some standardization among the plugins).

ryclorak avatar Jul 07 '21 00:07 ryclorak

Agree, would be quite cool!

but I wonder if there would be some way to do it without hardcoding the specific names of the plugins..

I did introduce an method to get all plugins in dev branch ;). On dev you can just call jarvis.get_plugins()

https://github.com/sukeesh/Jarvis/blob/dev/jarviscli/jarvis.py#L115

pnhofmann avatar Jul 07 '21 15:07 pnhofmann

Alright, I'll get to working on this as soon as I can! Could you assign the issue to me?

williamwu062 avatar Jul 07 '21 21:07 williamwu062

I did introduce an method to get all plugins in dev branch ;). On dev you can just call jarvis.get_plugins()

https://github.com/sukeesh/Jarvis/blob/dev/jarviscli/jarvis.py#L115

So I can iterate over the dictionary of plugins, searching for a particular keyword (or partial), to pick the correct plugin based on user input and maybe even facilitate the use of that plugin? How would I actually call a plugin with get_plugins()?

ryclorak avatar Jul 10 '21 03:07 ryclorak

So I can iterate over the dictionary of plugins, searching for a particular keyword (or partial)

It's actually a List of Plugin-Names. To call plugin, jarvis.execute_once(s) could be used, which would execute a string just like it was typed by the user. But this isn't perfect - maybe we should add a 'eval(plugin, string)' method? Suggestions are welcome.

pnhofmann avatar Jul 10 '21 08:07 pnhofmann

Hi I've finished programming the random command, I was just wondering if there is a good way to test it through the dev branch. Whenever I try to run Jarvis through that branch, I run into a multitude of errors that the master branch otherwise did not have. But I also need the dev branch to have access to jarvis.get_plugins() and jarvis.execute_once(s)

williamwu062 avatar Jul 27 '21 21:07 williamwu062

Hi, Sorry, for long delay. Yeah, just send a PR and I'll take a look ;).

pnhofmann avatar Aug 07 '21 10:08 pnhofmann