Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(spec): add subcommands to Notation plugin spec #555

Merged
merged 9 commits into from
Mar 29, 2023
46 changes: 43 additions & 3 deletions specs/commandline/plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Usage:

Available Commands:
list List installed plugins
install Installs a plugin
remove Removes a plugin

Flags:
-h, --help help for plugin
Expand All @@ -36,15 +38,53 @@ Aliases:
list, ls
```

### notation plugin install

```text
Installs a plugin
duffney marked this conversation as resolved.
Show resolved Hide resolved

Usage:
notation plugin install [flags] <plugin path>

Flags:
-h, --help help for install

Aliases:
install, add
```

### notation plugin remove

```text
Removes a plugin

Usage:
notation plugin remove [flags] <plugin name>

Flags:
-h, --help help for remove

Aliases:
remove, rm, uninstall, delete
```

## Usage

### Install a plugin

Currently there is no subcommand available for plugin installation. Plugin publisher should provide instructions to download and install the plugin.
```shell
notation plugin install <plugin path>
```

Upon successful execution, the plugin is moved to plugins directory. If the plugin directory does not exist, it will be created. The plugin installation is then verified and if the verification fails, the plugin is removed from the plugins directory and an error is returned. When an existing plugin is detected, the versions are compared and if the existing plugin is a lower version then it is replaced by the newer version.
duffney marked this conversation as resolved.
Show resolved Hide resolved

### Uninstall a plugin

Currently there is no subcommand available for plugin un-installation. Plugin publisher should provide instructions to uninstall the plugin.
```shell
notation plugin remove <plugin name>
```

Upon successful execution, the plugin is removed from the plugins directory. If the plugin is not found, an error is returned showing the syntax for the plugin list command to show the installed plugins.

### List installed plugins

Expand All @@ -58,5 +98,5 @@ An example of output from `notation plugin list`:

```text
NAME DESCRIPTION VERSION CAPABILITIES ERROR
azure-kv Sign artifacts with keys in Azure Key Vault v0.3.1-alpha.1 [SIGNATURE_GENERATOR.RAW] <nil>
azure-kv Sign artifacts with keys in Azure Key Vault v0.5.0-rc.1 [SIGNATURE_GENERATOR.RAW] <nil>
```