support a `path` argument to `amplify plugin add`
Is this feature request related to a new or existing Amplify category?
New category
Is this related to another service?
No response
Describe the feature you'd like to request
Support a path argument on amplify plugin add to simplify command:
amplify plugin add --path $(pnpm root -g)/amplify-graphql-seed-plugin
Currently we need to first capture the absolute path, and paste it in to the required prompt
> echo $(pnpm root -g)/amplify-graphql-seed-plugin | pbcopy
> amplify plugin add
? Enter the absolute path for the root of the plugin directory:
/Users/josef/Library/pnpm/global/5/node_modules/amplify-graphql-seed-plugin
Successfully added plugin package.
? Run a fresh scan for plugins on the Amplify CLI pluggable platform Yes
Describe the solution you'd like
see above
Describe alternatives you've considered
n/a
Additional context
No response
Is this something that you'd be interested in working on?
- [ ] 👋 I may be able to implement this feature request
Would this feature include a breaking change?
- [ ] ⚠️ This feature might incur a breaking change
Hi @josefaidt @ykethan, is this issue up for grab? I would like to take this up. Thanks!
It seems this is already possible and the path can be provided at the end of the command like so:
amplify plugin add $(pnpm root -g)/amplify-graphql-seed-plugin
See example:

The function resolvePluginPathAndAdd accepts an inputPath:
https://github.com/aws-amplify/amplify-cli/blob/7264e275306500f9b0e203dcaab3432db06d3cd4/packages/amplify-cli/src/commands/plugin/add.ts#L40-L45
The main run function reads the path from the cli subcommands and passes it along to this function: https://github.com/aws-amplify/amplify-cli/blob/7264e275306500f9b0e203dcaab3432db06d3cd4/packages/amplify-cli/src/commands/plugin/add.ts#L18-L34
@josefaidt does passing the path like this suffice or was this issue meant to have some extra functionality?
@josefaidt As @meshde indicated, we can specify the absolute path to the plugin on the add command. If there is anything missing in this functionality, I think it needs to be discussed in this issue. What do you think?
Is this issue still needed?