@headlamp-k8s/pluginctl
A lightweight CLI tool for managing Headlamp plugins.
Purpose
This package provides a minimal, focused tool for managing Headlamp plugins. It's ideal for:
- Installing plugins from ArtifactHub
- Managing plugin configurations
- Performing bulk plugin operations via configuration files
Usage
pluginctl.js <command>
Commands:
pluginctl.js extract <pluginPackages> Copies folders of packages from plug
<outputPlugins> inPackages/packageName/dist/main.js
to
outputPlugins/packageName/main.js.
pluginctl.js package [pluginPath] Creates a tarball of the plugin
[outputDir] package in the format Headlamp
expects.
pluginctl.js install [URL] Install plugin(s) from a
configuration file or a plugin
artifact Hub URL
pluginctl.js update <pluginName> Update a plugin to the latest
version
pluginctl.js uninstall <pluginName> Uninstall a plugin
pluginctl.js list List installed plugins
Options:
--version Show version number [boolean]
--help Show help [boolean]
Configuration File Format
plugins.yaml:
plugins:
- name: my-plugin
source: https://artifacthub.io/packages/headlamp/test-123/my-plugin
version: 1.0.0
- name: another-plugin
source: https://artifacthub.io/packages/headlamp/test-123/another-plugin
dependencies:
- my-plugin
installOptions:
parallel: true
maxConcurrent: 3
Available Classes
The package exports the following classes for programmatic use:
PluginManager: Core class for managing individual plugins
MultiPluginManager: Class for handling multiple plugins and their dependencies
Example usage:
const { PluginManager, MultiPluginManager } = require('@headlamp-k8s/pluginctl');
const manager = new PluginManager();
const multiManager = new MultiPluginManager();
Using npm link for Development
To test your local changes to pluginctl in other packages:
cd plugins/pluginctl
npm link
- In the project where you want to use the local version:
npm link @headlamp-k8s/pluginctl
This will create a symlink to your local development version instead of using the published package. This is useful for:
- Testing changes before publishing
- Debugging issues
- Developing features that require changes in both packages
To unlink:
npm unlink @headlamp-k8s/pluginctl
Relationship with @kinvolk/headlamp-plugin
pluginctl is a minimal tool focused solely on plugin management operations. It provides the core functionality for:
- Installing plugins
- Updating plugins
- Removing plugins
- Listing installed plugins
In contrast, @kinvolk/headlamp-plugin is a comprehensive package that includes:
- All plugin management features from pluginctl
- Plugin development tools
- Build and testing infrastructure
- Code quality tools
Choose pluginctl if you only need plugin management features, or headlamp-plugin if you need the full development toolkit.