amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

support a `path` argument to `amplify plugin add`

Open josefaidt opened this issue 3 years ago • 2 comments

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

josefaidt avatar May 25 '22 14:05 josefaidt

Hi @josefaidt @ykethan, is this issue up for grab? I would like to take this up. Thanks!

Shivansh2407 avatar Aug 06 '22 06:08 Shivansh2407

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: Screenshot 2022-08-06 at 6 26 55 PM

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?

meshde avatar Aug 06 '22 13:08 meshde

@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?

fossamagna avatar Apr 26 '23 13:04 fossamagna

Is this issue still needed?

redjonzaci avatar May 03 '23 23:05 redjonzaci