forslund / cmd_skill

A simple mycroft skill for launching shell scripts and system commands
GNU General Public License v3.0
12 stars 7 forks source link

readme is unclear #4

Open ITCMD opened 5 years ago

ITCMD commented 5 years ago

For new users, can you indicate where we should be putting that example code (what file and where). Also some basic installation instructions would be appreciated.

georgefst commented 4 years ago

Indeed, assuming this still works at all, how would one go about actually using it @forslund?

I can't find any info on installing a skill that's not in the marketplace.

forslund commented 4 years ago

Hi!

To install it you can use the command line tool msm and install a git repo directly (from the mycroft-core folder run ./bin/mycroft-msm install https://github.com/forslund/cmd_skill)

I tested the skill again now and it works as well as it did. I inserted the following config snippet:

  "CmdSkill": {
    "alias": {
      "mines": "gnome-mines"
    }
  }

into the ~/.mycroft/mycroft.conf config. You might want to use the mycroft-config tool, it has some json validation warning of incorrect syntax.

And could launch gnome-mines with the voice command run mines

georgefst commented 4 years ago

It works! Thanks

GoldenbyteGH commented 3 years ago

Is possible to run python scripts with this skill? Are there any example or external documentation?

jamiebrowncow commented 2 years ago

This still seems to install on the most current version, but mycroft.conf is now located in .config/ not .mycroft/ I added your test command and validated, but it doesn't work, and mycroft wont load. Tried original spacing, output shows without the spacing. 2022-10-06 00:48:23.249 | ERROR | 7665 | mycroft.configuration.config:load_local:113 | Error loading configuration '/home/jay/.config/mycroft/mycroft.conf' 2022-10-06 00:48:23.271 | ERROR | 7665 | mycroft.configuration.config:load_local:114 | JSONDecodeError('Extra data: line 1 column 11 (char 10)',) 2022-10-06 00:48:23.345 | ERROR | 7665 | mycroft.configuration.config:load_local:113 | Error loading configuration '/home/jay/.config/mycroft/mycroft.conf' 2022-10-06 00:48:23.358 | ERROR | 7665 | mycroft.configuration.config:load_local:114 | JSONDecodeError('Extra data: line 1 column 11 (char 10)',) 2022-10-06 00:48:23.378 | ERROR | 7665 | mycroft.configuration.config:load_local:113 | Error loading configuration '/home/jay/.config/mycroft/mycroft.conf' 2022-10-06 00:48:23.388 | ERROR | 7665 | mycroft.configuration.config:load_local:114 | JSONDecodeError('Extra data: line 1 column 11 (char 10)',) 2022-10-06 00:48:23.435 | ERROR | 7665 | mycroft.configuration.config:load_local:113 | Error loading configuration '/home/jay/.config/mycroft/mycroft.conf' 2022-10-06 00:48:23.447 | ERROR | 7665 | mycroft.configuration.config:load_local:114 | JSONDecodeError('Extra data: line 1 column 11 (char 10)',) 2022-10-06 00:48:23.836 | ERROR | 7665 | mycroft.configuration.config:load_local:113 | Error loading configuration '/home/jay/.config/mycroft/mycroft.conf' 2022-10-06 00:48:23.847 | ERROR | 7665 | mycroft.configuration.config:load_local:114 | JSONDecodeError('Extra data: line 1 column 11 (char 10)',)

jamiebrowncow commented 2 years ago

No longer works.

forslund commented 2 years ago

Thanks for reporting. I'll update the readme and will do a testrun tonight.

Btw can you provide the final json in your mycroft.conf? Looks like it's not valid. (I probably made some typo in the instructions)

forslund commented 2 years ago

I tested here (mycroft dev branch) and the skill seems to be working when using the example config.

jamiebrowncow commented 2 years ago

Can you share your configuration as it is working for you? I would like to use your skill if possible, it is obviously worth the effort, but I am also new to mycroft so without being a 'pleasebro', if you can share the file and location you added your directive?

forslund commented 2 years ago

I've got a lot of crud in my config. See link in the bottom.

Here is what a minimal config based on a fresh Mycroft install should look like:

{
  "max_allowed_core_version": 21.2,
  "CmdSkill": {
    "alias": {
      "generate report": "/home/forslund/scripts/generate_report.sh",
      "mines": "gnome-mines"
    }
  }
}

Above I have two commands generate report and mines.

For my full config you can look here: https://gist.github.com/forslund/c9e3c982afab14f31821fc60d64fcf1b

forslund commented 1 year ago

@jamiebrowncow did you have any luck with above config examples?