Skip to main content

plugins.install

Downloads a plugin from a GitHub release and adds it.

  • It fetches releases/tags/<version> and downloads the first asset, which must be a zip with plugin.lua at its root.
  • The zip is saved as <state_dir>/plugins/<owner>_<repo>_<tag>.zip.
  • The stored metadata is {"source": "github", "owner", "repository", "version"}, which plugins.upgrade relies on.

Request​

{
"owner": "porla-plugins",
"repository": "metrics",
"version": "v0.1",
"config": "return {}"
}

Response​

{
"id": 8
}

Errors​

CodeReason
-2Release not found
-3Failed to parse release body as JSON
-4Release has no downloadable assets
-5Failed to fetch release asset
-6Failed to write release archive to <path>
-7Plugin path is used by another plugin