Build an open future with us.

Invest in Mycroft and become a community partner.

THEIA IDE skill [CLOSED]


#1

THEIA IDE

VS Code experience on your Mycroft device

How to install THEIA IDE skill

  • Install THEIA IDE skill by …
    To get Theai IDE to comile it is needed to encrease the swapsize. This is none by editing the file /etc/dphys-seapfile and setting changing CONF_SWAPSIZE=100 to 2048

to do that ssh into your device and do:

sudo nano /etc/dphys-swapfile

exit by Ctrl+X and save And restart swarpfile

sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start

Install the skill by

mycroft-msm install https://github.com/andlo/theia-ide-skill.git

Skill wil then install THEIA IDE. This takes more than 15 minutes, and will slow your Mycroft device down when compiling node-modules.

When done, there should be a log info saying “Starting THEIA IDE” You can then open a web-browser and gå to http://picroft:3000 if your Mycroft device is picroft. If on a Mark One go to http://mark_1:3000/ You then get access to the THEIA IDE in a workplace located /opt/mycroft/skills.

THEIA IDE skill connects to absolutly no online service.

but If you want, THEIA has a great Github integration.

How to test THEIA IDE Skill

  • Installing and setup
  • Running and access to THEIA http://picroft:3000
  • Therminal and use og mycroft specifik commands
  • Git integration - Pull and push and monitor changes etc.
  • Search throu all workspaceses
  • Python Language server support - formatiing and highlight etc
  • Does you have problems that new files has CRLF and not just LF.

Where feedback on SKILL NAME should be directed a

Feedback will be apriciated here or through Issues on GitHub, or via Mycroft Chat.


#2

Forgot to telle how to remove the skil or reinstall

Delete skill from /opt/mycroft/skills by deleting directory or by

mycroft-msm remove theia-ide-skill

Delete directory /hoem/pi/.mycroft/skills/TheiaIde


#3

great tool for small skill developers very easy to handle. Thank you


#4

Yah it is neat :slight_smile:
I want a easy way to get acces to make skills, so newcommers or people who dosnt have setup thier personal dev envioment to get an easy start in making skills. This is a way to do that.


#5

How to test THEIA IDE Skill

  • Installing and setup
    After changing CONF_SWAPSIZE=100 to 2048 and restart of /etc/init.d/dphys-swapfile my PiCroft slowed totally down, had to reboot the RPI. Afterwards installation went smooth but took really long…
    Should the swapsize configuration stay at 2028 for normal use or can it be changed back to original value?

  • Running and access to THEIA http://picroft:3000
    works! :+1:

  • Therminal and use og mycroft specifik commands
    works! :+1:

  • Git integration - Pull and push and monitor changes etc.
    does not work :confused:, I get errors like GitError: error: option 'porcelain' takes no value usage: git status [options] [--] <pathspec>...

  • Search throu all workspaceses
    search for “mycroft” gives me tons of results - and it this was fast too -woohoo

  • Python Language server support - formatiing and highlight etc
    works! :+1:

  • Does you have problems that new files has CRLF and not just LF.
    not sure how to test it… a new created file is properly shown with less or when opened with nano


#6

Thanks for feedback

The git integration laks the posibility to hold your git username and password. but you should be able to get git to remember
In the terminal ou can type

git config --global credential.helper store

When running this command, the first time you pull or push from the remote repository, you’ll get asked about the username and password.

So do a git pull or push by

git pull

And you will be ask credentials.

After on, for consequent communications with the remote repository you don’t have to provide the username and password.

And then the git integration works

The storage format is a .git-credentials file, stored in plaintext. So it isnt that secure, so be aware.

Also, you can use other helpers for the git config credential.helper , namely memory cache:

git config credential.helper cache <timout>

which takes an optional timeout parameter , determining for how long its deamon should run and the default value of it is 900 seconds (15 minutes).

The CRLF problem yoou can test by

Make a new file test.sh
in that enter

#!/bin/bash
echo this is a test

save it and in the terminal do

chmod +x test.sh
./test.sh

If there is a problem it wil sav error blablabla but see ^M
If there isnt an error you see the text “this is a test”


#7

But did just check on a new install….there is a problem whith CRLF vs LF.

You can copy the .editorconfig file from the skill directory /files to /opt/mycroft/skills

I will add that to the installer.


#8

That is a good question. I am from the old school where it is good practice to have same or dubbel size swap as memmory on small or old systems. And a Rpi is a small system :wink:
I will test how it perform if changing swapsize back to 100.


#9

it can defently not run whith only 100 mb swap…maybe if disabling python linting and language serviceses. Biy I think that is something that is very nice when coding….
I will see what can be done and where to tune.


#10

wow - I changed and loads lesser python language server plugins, and that seems to do good for memoryuse. But swap IS needed, as when mycroft does something like update skills, there isnt enough free mem, and everything stalls and get reall slow.

So I recoment keeping 2048 ar swapsize.

The only downside by that is it takes some space on the SD card.


#11

OK I did do a lot of work……

ow everything is precompiled and the skill “only” download a package and unzip it. So nomore need for encreasing swapfile or waite for long time.

Also removing skill removes everything nice and clean.

Gitintegration works now on Mark_1 to but I still se some difference compared to picroft that I am investigating.


#12


#13

That looks very nice @andlo

Will flash the latests picroft to SD to give it a go. Probably after the weekend though. As feature request although not sure if it maybe is already there or even possible, but;

Nice and easy implementation of MSK (without the need of that “terminal”, I mean).

That way, it will be very easy for newcomers to quickly create, develop and publisch a skill all made on the development platform of Mycroft itself.

Kudoos!


#14

Regarding “Nice and easy implementation of MSK (without the need of that “terminal”, I mean).” what do you think can be made easier? Adding a msk menu to run the msk commands, as the msk is alreddy pritty easy.

One way could be opening a file where one could fill out the stuff, and then parse it throug msk. Maybe adding funktions to msk to take input from a predefined file.

But if you ask me, it is simple as it is. And people who wants to make skills, do know some thing about running a command. Acces to terminal is right in the menu, and everything is setup for it to work.

What I think is important in this skill is making it easy for newcommers to get setup whith all the good stuff so they dont (like I did) start maing skills by SSH and nano (nano is good, but a real IDE is better)


#15

To be honest with you @andlo I have not yet tried it out. Your skill and/or msk, so ignore me untill I at least did. But, yeah meant something like a menu item -> new -> skill. :wink:

Anyhow you indeed make it a whole lot easier for newcommers to start making their own skill. Let the market flooding begin…:stuck_out_tongue_winking_eye::joy:


#16

There is - as I am reading the stuff at theia-ide.org ways to enharnce the IDE and there is an example for how t make menus, but I think first thing is to get it running, and running stable.
But the goal is certenly to make it easy to get started.
I would like to have a first run file opened, with information and links for how to use the IDE and how to make skills and maybe some basic good terminal commands for restarting skills and showing logs etc.
also I would like a way to update the IDE, as there will be comming more stuff for it in the future. Maybe adding extensions, like we know it form VS code. Not stuff I make, but stuff I could get into the precompiled package.
Right now the biggest problem seems that some parts dosnt work on mark_1. I got git integration fixed, and language server support, but seems like python linting isnt dooing what it sopposed to do.

Also I need to figure out how to control the running proces from the skill - as it is now I just start the IDE whith a systemcall. I think there is a better way using python subprocess, but hassnt found a good example, and I cant program if I cant copy stuff :wink:


#17

The mising stuff on mark_1 is now fixed :slight_smile:
Only difference should be that on picroft the user is pi, and on mark_1 the user is mycroft


#18

Check the UID, perhaps they have the same number and you can use that.


#19

I am not sure what you want….the IDE runs under the user that start it, and on pi that is the i user (as he is the one running mycroft servises) and under mark_1 it it mycroft user.mycroft user issnt allowed to su ther users…so cant figure out how to actualy change user on mak_1. Besides - as mycroft user owns the skills installed, I think he should be the one running the IDE to…


#20

otherwise - the IDE shouldnt be installed from mycroft, but by ssh and run installer. Then I can do the stuff - but that does remove the thinking of having a skill to do the install and setup and oneday controlling the IDE.