feat(plugins): Add plugin support
Description
Plugins allow users to extend the capabilities of the CLI. To build one, the plugin must adhere to the following:
-
The plugin must start with the app prefix and separated by a dash. For example:
$ glab-echo
-
The plugin executable must be locatd somewhere along your
$PATH
. -
The plugin must respond with a JSON object that includes the version and description when it's invoked with the
--metadata
flag. For example:$ glab-echo --metadata {"version": "v1.0.0", "description": "Short description"}
-
The plugin must be enabled manually before it's run. This is a security measure to ensure that only vetted plugins are run. To enable the plugin, run
glab plugin enable [plugin]
. For example, to enable theecho
plugin (backed byglab-echo
), you'd run:$ glab plugin enable echo
When a plugin is enabled, a checksum of the executable is saved. If the executable is modified, the plugin will fail to run, and log a message asking the user to re-enable the plugin. Ideally this means vetting the executable once more re-enablement.
Related Issues
Resolves #1053
How has this been tested?
TODO
Screenshots (if appropriate):
TODO
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap