diff --git a/website/content/docs/plugins/creation/index.mdx b/website/content/docs/plugins/creation/index.mdx index 898fb61e4..9a981eb41 100644 --- a/website/content/docs/plugins/creation/index.mdx +++ b/website/content/docs/plugins/creation/index.mdx @@ -247,16 +247,31 @@ scope of a plugin. ### Testing Plugins -Making your unpublished plugin available to Packer is possible by either: +To install plugins from local source, you can use the `packer plugins install` command with the `--path` flag: -- Starting Packer from the directory where the plugin binary is located. -- Putting the plugin binary in the same directory as Packer. +```shell-session +$ packer plugins install --path // +``` + +For example let's install happycloud plugin from a locally sourced binary + +```shell-session +$ packer plugins install --path packer-plugin-happycloud github.com/hashicorp/happycloud +``` -In both these cases, if the binary is called `packer-plugin-myawesomecloud` and -defines an `ebs` builder then you will be able to use an `myawesomecloud-ebs` -builder or source without needing to have a `required_plugin` block. +This will install the happycloud plugin from the `packer-plugin-happycloud` binary so Packer can discover it. +If you want to use this in an HCL2 template, you can optionally add it to the `required_plugins` section like so: + +```hcl + required_plugins { + happycloud = { + source = "github.com/hashicorp/happycloud" + version = ">=0.0.1" + } +} +``` -This is extremely useful during development. +For further information on how Packer discovers and loads plugins, you may refer to our [documentation](/packer/docs/plugins/creation/plugin-load-spec) on the subject. ### Distributing Plugins