aws-amplify / aws-amplify/amplify-cli
DX suggestion: Add a warning on windows if using the CLI when its not in admin mode
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 825
- Avg merge
- 11d 23h
- Merged PRs (30d)
- 2
Description
### Is this related to a new or existing Amplify category?
interactions
### Is this related to another service?
_No response_
### Describe the feature you'd like to request
Just lost best part of 6 hours trying to debug an issue with my environments in the CLI (couldn't checkout my live environment).
Turns out the error I was getting (something about symlinks) went away if I just ran my console in admin mode (I'm on Windows 10, using Windows Terminal).
In the discord channel turned out I wasn't the only one () so that got me thinking. Why not show a warning if you try to interact with Amplify on a windows machine that doesn't have admin elevated privileges'.
### Describe the solution you'd like
I'm not sure if its even possible to know if the command window has admin permissions or not from code. If there is then it should be hopefully easy to add a little warning every time you try to run an amplify command which would check if you are in "normal" mode and if so render a one liner about:
_"You appear to not be running with admin permissions, to avoid errors we suggest you do, more details at "_
If we can't detect if we are admin or not then how about rendering something like the below whenever there is an error as a bit of a hint or something to try/check:
_"Are you running the CLI in a command window with admin permissions, some errors disappear when Amplify has admin persmissions, more details at "_
Again this is only for Windows I believe and I'm pretty sure that you can detect if its windows or not.
Ideally the blog/issue should explain how to give the CLI admin permissions too (crash course is search for "cmd" on the start menu, right click on the Command Line icon and select "Run as administrator" just incase you aren't a windows user).
### Describe alternatives you've considered
Make it not use symlinks?
Make it not a requirement to need admin mode...but thats more of a windows issue rather than your stuff.
### Additional context
https://discordapp.com/channels/705853757799399426/708077731711156284/883302432875102239
https://github.com/aws-amplify/amplify-cli/issues/984#issuecomment-472444964
https://github.com/aws-amplify/amplify-cli/issues/6138#issuecomment-742730830
### 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
Research direction
The issue names no files, tests, or entry points; begin by locating the CLI command bootstrap and the Windows-specific error handling around symlink or environment operations. Confirm whether administrative elevation can be detected reliably, decide when the warning should appear, and document how the user can resolve it; done means a tested, non-disruptive Windows warning with helpful guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100