Kodi Community Forum
Install addons from command line - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Install addons from command line (/showthread.php?tid=120248)

Pages: 1 2


Install addons from command line - speechkey - 2012-01-17

Hi folks,
is there any workaround to install addons from zip file over command line?

Thanks for help!


- stoli - 2012-01-17

They just need to be unzipped to the addons folder, they do not have to be installed via the gui.


- speechkey - 2012-01-18

Hi stole, thanks for your reply, sorry I'll redefine my question, how could I enable certain add-on via command line and configure it? I would appreciate for a link on any useful manual.

Merci.


- speechkey - 2012-01-18

Lets take for example passion repo zip file contains addon.xml with:
[HTML]<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="repository.passion.xbmc.org"
name="Passion-XBMC.org Add-ons"
version="1.0.4"
provider-name="Team Passion-XBMC">
<extension point="xbmc.addon.repository"
name="Passion-XBMC Add-on Repository">
<info compressed="true">http://passion-xbmc.org/addons/addons.php</info>
<checksum>http://passion-xbmc.org/addons/addons.xml.md5</checksum>
<datadir zip="true">http://passion-xbmc.org/addons/Download.php</datadir>
</extension>
<extension point="xbmc.addon.metadata">
<summary>Install Add-ons from passion-xbmc.org</summary>
<summary lang="fr">Installez des Add-ons depuis passion-xbmc.org</summary>
<description>Download and install Add-ons from passion-xbmc.org</description>
<description lang="fr">Téléchargez et installez des Add-ons depuis passion-xbmc.org</description>
<platform>all</platform>
</extension>
</addon>
[/HTML]

I asume, that I could get addons properties from http://passion-xbmc.org/addons/addons.php under which I've got an addons.xml with strange xml:
[HTML]
<?xml version="1.0" encoding="UTF-8"?>
<addons>
<addon id="script.game.tic.tac.toe" name="Tic Tac Toe" version="1.0.2" provider-name="Frost (passion-xbmc.org)">
<requires>
<import addon="xbmc.python" version="1.0"/>
</requires>
<extension point="xbmc.python.script" library="default.py"/>
<extension point="xbmc.addon.metadata">
<platform>all</platform>
<nochangelog>true</nochangelog>
<summary>Tic Tac Toe for XBMC</summary>
<description>Jeu du Tic Tac Toe ou dit aussi Morpion. Jouer contre XBMC ou avec un deuxième joueur.</description>
</extension>
</addon>
...
[/HTML]

I'm checkin, that <addon> node has addons properties, with will be installed,
but I dont understand yet how could I install and add some custom configuration for example for this Tic Tac Toe add-on.


- htpc guy - 2012-01-18

Not really sure why you would want to configure the addon from command line? Unzip the addon to your addon directory. Then open XBMC, highlight the addon, press C and choose the option to configure the addon.

Only reason I can think of that you want to do this by command line is if you want to set up multiple machines. Anyway, you cannot configure them by command line. I do think the settings get stored in the addonsettings.xml file though so you could edit that file.

elaborate more on what you are trying to do if my post is not helpful.


- speechkey - 2012-01-18

htpc_guy, or on remote machine without vnc over ssh Wink) But yes, I have 3 machines on which I would like to install xbmc with same addons.


- htpc guy - 2012-01-18

Are they 3 identical machines with the same paths?

Upon further inspection, the addon settings are stored at %/xbmc/userdata/addon_data. Each configurable addon will store settings in .xml files located in a folder named after the addon that created it. So if you push this folder to the correct location on your clients then they will have the correct configuration when you launch them.

Maybe try this workflow...
install the addon on one machine and configure it the way that you like.
push the addon and the addon_data folder to the remaining machines. Make sure the folders end up in the correct location.


- speechkey - 2012-01-18

htpc guy, this sounds pretty cool, nice solution, I'm very sure — it will work like that. Thank you very much.


- spiff - 2012-01-19

If you manually unzip you are on your own. In particular dependencies will not be resolved.


RE: Install addons from command line - darwin - 2016-12-20

For the benefit of future people who find this via google, in particular adding *repositories* from the command line in this way is likely to work, because they don't tend to have any dependencies.

1) Download repository file.
2) unzip inside of <kodihomedir>/addons/
3) restart kodi


Install addons from command line - Memphiz - 2016-12-20

And just read the post above yours which might be 5 years old but is still true...


RE: Install addons from command line - myfototv - 2017-05-31

if you extract a zip into addons folder or copy a plugin.video.someaddon folder into addons it wont register in kodi until the system has been rebooted so i guess the question stands as

"what is the built-in command (AKA: Install From Zipfile from the GUI) to install a zipfile so that kodi doesnt have to reboot to recognise that newly created/copied/extracted folderHuh"

Any help would be greatly apreciated


RE: Install addons from command line - DarrenHill - 2017-06-01

I'm not sure there is one, as Kodi is not designed to work this way.

Also note from Kodi Krypton (v17) onward, any add-on installed this way will also by default be disabled on the restart, and will need manually enabling (aside from the potential issues of dependencies already mentioned).


RE: Install addons from command line - trogggy - 2017-06-01

'UpdateLocalAddons' - 'Triggers a scan of local add-on directories.'
list_of_built-in_functions (wiki)

As above though, anything manually placed in the addons folder will stay disabled forever unless / until you enable it.


RE: Install addons from command line - mv150 - 2017-11-05

I am currently working on the setup of my Kodi box  using Ansible for easy reproducibility in case a system reinstall is required.

Update2:

Using kodi-send as mentioned below unfortunalely only seems to work for addon-packages that already have been downloaded and are present on the packages-directory.

Update:
I discovered a much simpler and straight-forward way to install any addon via command line.
Code:
$ kodi-send --action="InstallAddon(service.tvheadend42)"

Note that this still triggers a GUI dialog to confirm the required download.


For the sake of completeness, find my original post below.

For me, the following steps worked for installing and enabling a plugin using the command line. Note that the issue with unresolved dependencies still persists! For my example, there were no additional dependencies.

My system:
- Platform: Ordoid-C2
- Distribution: LibreELEC running Kodi 17.4 (Krypton)
- Addon: Tvheadend 4.2

Extract addon zip file to the addons-folder.
Code:
$ unzip service.tvheadend42-8.2.112.zip -d ~/.kodi/addons

Restart Kodi so that the newly installed addon gets registered. In my case, this could be done using systemd.
Code:
$ systemctl restart kodi.service


Now, we need to edit the Kodi internal database to enable the addon.
Code:
$ sqlite3 ~/.kodi/userdata/Database/Addons27.db 'update installed set enabled=1 where addonid=="service.tvheadend42";'

However, this apparently only updates the state of the addon shown in the Kodi GUI.
To properly enable and start the service in the backend, again, systemd can be used.

Link the unit file that comes with the addon to the Kodi systemd directory and reload systemd units.
Code:
$ ln -s ~/.kodi/addons/service.tvheadend42/system.d/service.tvheadend42.service ~/.config/system.d/
$ systemctl daemon-reload

Enable the service.
Code:
$ systemctl enable service.tvheadend42.service

To make sure the newly installed plugin is properly loaded and integrated into the (currently still running) Kodi instance, we should stop Kodi and reload it with all it's dependencies (in terms of systemd).
Code:
$ systemctl stop kodi.service
$ systemctl isolate kodi.target

This steps might not be working on other distributions, but might be helpful to get a clue for others to get things working.