aws-amplify / aws-amplify/amplify-cli

Install/run Amplify as a local package

Open
#9,266 6 comments 5 reactions 0 assignees View on GitHub
feature-request p4 platform
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### 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

I'd like to be able to install and run the Amplify CLI as a local package so that I can use `npx` to run it:

```
npm --save-dev install @aws-amplify/cli
npx amplify configure
```

### Current experience

This scenario is clearly not supported today:

```
$ npm --save-dev install @aws-amplify/cli
...
$ npx amplify configure
? Select the backend providers. (Press to select, to toggle all,
to invert selection)
```

(no list is shown, pressing space does nothing)

```
$ npx amplify pull
```

### Use cases

* ~~Install amplify without sudo~~ (edit: this can be accomplished by [setting a custom NPM prefix](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally/#manually-change-npms-default-directory))
* Lock my version of the Amplify CLI with my project's `package.json` file
* Upgrade the Amplify CLI along with the rest of my project's dependencies
* Be notified of security vulnerabilities found in the Amplify CLI by `npm audit`
* Fix security vulnerabilities found in the Amplify CLI by running `npm audit fix`

### Related issues, documentation, etc

#4491 (2020, closed due to inactivity)
#4485 (2020, closed due to inactivity)
#839 (2019, closed due to inactivity)

PR #3857 (closed due to inactivity)

For more about npx, iincluding use cases, see the _npx launch blog post_ (2017): https://blog.npmjs.org/post/162869356040/introducing-npx-an-npm-package-runner

### Describe the solution you'd like

See above

### Describe alternatives you've considered

I've considered installing amplify globally. It would have to be manually updated, since my package manager would not be aware of it.

I've considered running a dockerized Amplify CLI. This would provide secure and repeatable builds but it's also more work to set up and troubleshoot.

Edit: It's possible to install Amplify globally without sudo by setting a custom npm prefix. This mitigates some of my security concerns and allows the use of `npx`.

### Additional context

* _The problem with npm install --global_ (2017): https://ericlathrop.com/2017/05/the-problem-with-npm-install-global/
* _Avoid global npm installs for projects_ (2015): http://www.gjermundbjaanes.com/avoid-global-npm-installs-for-projects/

### Is this something that you'd be interested in working on?

- [ ] 👋 I may be able to implement this feature request
- [ ] ⚠️ This feature might incur a breaking change

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.