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 @@ -36,15 +36,55 @@ Aliases:
list, ls
```

### notation plugin install

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

Usage:
notation plugin install --name <plugin name> --plugin-package <plugin package> [flags]
duffney marked this conversation as resolved.
Show resolved Hide resolved

Flags:
-n, --name string name of the plugin
duffney marked this conversation as resolved.
Show resolved Hide resolved
duffney marked this conversation as resolved.
Show resolved Hide resolved
-p, --plugin-package string path to the plugin package
-h, --help help for install

Aliases:
install, add
```

### notation plugin remove

```text
Removes a plugin

Usage:
notation plugin remove <plugin name> [flags]
duffney marked this conversation as resolved.
Show resolved Hide resolved

Flags:
-h, --help help for remove

Aliases:
remove, rm
duffney marked this conversation as resolved.
Show resolved Hide resolved
```

## 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 --name <plugin name> --plugin-package <plugin package>
duffney marked this conversation as resolved.
Show resolved Hide resolved
duffney marked this conversation as resolved.
Show resolved Hide resolved
```

Unpon successful execution, the plugins directory is created under the default plugin directory if it does not exist, and the plugin package is extracted to the plugins directory. The plugin installation is then verified. If the verification fails, the plugin is removed from the plugins directory and an error is returned.
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>
```