Skip to main content

volumio-plugin CLI

BetaThe plugin SDK and these pages are new. They change with each release, as developers use them and tell us what works.View as Markdown

volumio-plugin is the command-line tool of the Volumio plugin SDK, published on npm as @volumio/plugin-sdk. It creates, checks, packages and installs plugins.

Run a command​

Run any command through npx, from the plugin's folder:

npx --package=@volumio/plugin-sdk volumio-plugin <command> [arguments] [options]

The CLI needs Node.js 20 or later. deploy and logs need Node.js 22 or later, for its built-in WebSocket. --help, -h or help prints the usage.

CommandDoes
initCreates a new plugin from a template
checkRuns the gates G1 and G2 on a plugin folder
packageBuilds the plugin package and runs every gate on it
archPrints the architectures the plugin declares
deployInstalls the plugin on a Volumio device and starts it
logsPrints a Volumio device's log as it is written

init​

Creates a new plugin in a folder that does not exist or is empty. The plugin runs on Volumio and passes every check.

volumio-plugin init <dir> --id <id> --type <type> --function <function> --title <title> --description <text> [--author <name>] [--skip-install]
OptionRequiredValue
<dir>YesThe folder to create
--idYesThe plugin's id: 2 to 64 letters, digits and underscores, starting with a letter or a digit. No hyphens.
--typeYesaudio_interface, miscellanea, music_service, system_controller, system_hardware or user_interface
--functionYesAn id from the function registry, or a new id in lowercase words joined by hyphens
--titleYesThe name shown in the store and the UI, 80 characters at most
--descriptionYesWhat the plugin does, in one sentence
--authorNoThe name in LICENSE. Default: The <title> authors
--skip-installNoSkips npm install, so no package-lock.json is written

A music_service gets the music service template, with Browse, play and search. Every other type gets the generic template. Plugin files lists the files.

check​

Runs gate G1, on the manifest and the required files, and gate G2, on the code and install.sh. Exits with 1 when any error is found.

volumio-plugin check [plugin-dir ...] [--built] [--json]
OptionValue
plugin-dirOne or more plugin folders. Default: the current folder
--builtChecks a built package instead of the source. Adds G1.main and G1.file.i18n
--jsonPrints the result as JSON

The first line counts the errors and warnings. Each finding has a severity, a rule id, a place and a fix:

✖ hello_volumio (v2): 1 error, no warnings
error G2.js.console-log index.js:82 console.log bypasses the Volumio logger
fix: Log through this.logger
SeverityMeaning
errorBlocks the pull request
warningReported, does not block
todoA field a plugin without volumio-plugin.json can add

A folder without volumio-plugin.json is read from its package.json. ShellCheck and gitleaks run only when they are installed. When one is missing, the last line says so: Not checked here: ShellCheck and gitleaks are not installed. The CI always has them. Plugin rules lists every rule.

package​

Builds the plugin package for the architecture of the computer it runs on, when the manifest declares it, and runs every gate on the result. Otherwise it builds for the first architecture the manifest declares: on an arm64 Mac, a plugin that declares armhf and amd64 is built for armhf. G3 still stops a native module built for the wrong architecture. The CI runs it for each architecture, inside Volumio's build container.

volumio-plugin package [plugin-dir] [--out <dir>] [--report-only]
OptionValue
plugin-dirThe plugin folder. Default: the current folder
--outThe folder to write to. Default: dist-plugin
--report-onlyExits with 0 even when a gate finds an error

package copies the plugin without .git, .github, .gitignore, node_modules, test folders, the --out folder, and AGENTS.md, CLAUDE.md and VOLUMIO_API.md, which are for you and your coding agent. It runs npm run build when the plugin has one. Then it installs the production dependencies and runs G1 with --built, G2 and G3. It writes three files:

FileHolds
<id>-<version>-<arch>.zipThe package
<id>-<version>-<arch>.zip.sha256The package's SHA-256 checksum
<id>-<version>-<arch>.provenance.jsonThe source repository and commit, the workflow run, the SDK version and every finding

The same commit always gives the same zip: files are sorted and share one modification time. That time is the commit time, or SOURCE_DATE_EPOCH when it is set. Outside a git checkout, package uses the current time and warns that the zip is not reproducible.

arch​

Prints the architectures in the manifest's arch field, as JSON.

volumio-plugin arch [plugin-dir]
["armhf","amd64"]

deploy​

Installs the plugin on a Volumio device of the local network and starts it, as the web UI would. No SSH is needed.

volumio-plugin deploy <device> [plugin-dir] [--zip <zip>]
OptionValue
<device>The device's IP address, such as 192.168.1.20. A .local name such as volumio.local does not resolve on every computer
plugin-dirThe plugin folder. Default: the current folder
--zipInstalls this package instead of building one. Use it for a plugin with native modules

deploy builds the package, serves it from your computer, and asks the device to install it. Then it reboots the device and starts the plugin. It prints the lines the device logged about the plugin, and every warning and error, then how many other lines it left out. A plugin already on the device is updated and keeps its settings. When the plugin did not start, deploy prints the whole log and exits with 1. When it cannot reach the device, the error says what to check.

logs​

Prints a Volumio device's log as it is written.

volumio-plugin logs <device> [--seconds <n>]
OptionValue
<device>The device's address
--secondsStops after this many seconds. Default: runs until Ctrl+C

Was this page helpful?