I’m learning Git, and have been able to successfully fork the mycroft-skills git (github.com/MycroftAI/mycroft-skills/) to a local directory. I’ve since added a skill I wrote myself, and have been able to successfully push it to my personal GitHub page.
My question is - how can I have my PiCroft look to that repository instead of the default
/MycroftAI/mycroft-skills/ one for skills? My idea is that as I make Push requests, my PiCroft will update with the new/updated skill. (This can be hopefully automatic, but I don’t mind running a command in PiCroft via ssh in the terminal there).
Does that make sense?
In case you are just trying to install Skills that aren’t in the Marketplace, you can install Skills directly from their github repo using:
$ mycroft-msm install https://github.com/author/my-skill-repo
So if you are just trying to install different Skills then this is much easier. If you are creating a curated list of Skills that can be installed using the voice command eg “Hey Mycroft, install cocktails” then you’d need to target a different skills-repo as you mentioned.
This is handled by the Mycroft Skills Manager. You can either pass the new repo url in:
or you could modify the SkillRepo class to set a new default.
Thanks! I think the second bit is what I’m looking to do.
Basically, I’m following the tutorial on making a Skill, and have forked the Mycroft skills to my personal GitHub, then done
git clone to my my computer. So now I have a folder on my computer called “mycroft-skills” and I’m adding in my custom Skill to that folder too.
I’m new to Git, but as I understand it, if I do a “Pull” on my GitHub “Mycroft” repo, it’ll update with whatever changes the main MyCroft git has done, but also keep any custom skills I’ve made? Then I’d just like my MyCroft to update with my repo, not the official MyCroft one …does that make sense?
Hey glad to hear you’re getting into Skill development
git pull it will pull down any changes that are on the repo that you have cloned. So in this example you have cloned:
https://github.com/yourself/mycroft-skills meaning that it will only pull changes that have been made to that repo, not changes made in
To keep your fork of mycroft-skills up to date with the
upstream repo (the official Mycroft version), you can follow these instructions: https://help.github.com/en/articles/syncing-a-fork
Mycroft by default doesn’t clone the mycroft-skills repo to your device as this includes all Skills that are in the Marketplace. Instead it creates
/opt/mycroft/skills and installs just the default Skills (weather, timer, datetime, etc). The Mycroft Skills Manager then checks the mycroft-skills repo to see if any Skills need updating. It also checks there when you say things like “install cocktails” to see which Skill you might mean.
It sounds like you might be adding your code and files directly into the mycroft-skills repo, is that right?
This will work for your purposes, but is not how we manage the Skills in the upstream repo. If you go here: https://github.com/MycroftAI/mycroft-skills you’ll see that clicking on a folder it doesn’t take you into a folder, it actually takes you out to that Skills repo. This is because the files of these Skills don’t live inside the mycroft-skills repo. The repo is actually just links to the Skills own repositories using a Git feature called “submodules”. These point to a Skill at a specific point in time, so we can be sure that we’ve verified the code works and is safe to run on devices.
Submodules are a bit of a pain to work with manually. This is not just for new devs, I have friends who are wizard level Git users who still hate submodules. Which is why we have the Mycroft Skills Kit to handle all the tricky stuff for you. When you’re ready to submit your own Skill to the Mycroft Marketplace you can just run
mycroft-msk submit /opt/mycroft/skills/your-skill
and MSK will do the rest for you.
It still sounds like you don’t really need your own fork of Mycroft Skills but if you’re learning Git workflows that’s good too
That helped me a lot, thanks!!!