microsoft / microsoft/winget-cli
Help should indicate --proxy/--no-proxy require ProxyCommandLineOptions, or --no-proxy should have a lower-friction escape path
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Brief description of your issue
winget upgrade --help lists both --proxy and --no-proxy, but using --no-proxy can fail before the command runs:
This feature needs to be enabled by administrators. To enable it, run "winget settings --enable ProxyCommandLineOptions" as administrator.
This is especially confusing when the user is trying --no-proxy because the configured proxy is broken.
Steps to reproduce
Run:
winget upgrade --help
Observe that help lists:
--proxy Sets a proxy to use for this execution
--no-proxy Disables proxy use for this execution
Then run:
winget upgrade --id Microsoft.PowerShell --source winget --accept-package-agreements --accept-source-agreements --disable-interactivity --no-proxy
Observed on winget v1.28.240:
此功能需要由管理员启用。若要启用它,请以管理员身份运行 “winget settings --enable ProxyCommandLineOptions”。
Expected behavior
Either:
- Help should annotate
--proxyand--no-proxyas requiringProxyCommandLineOptions, or hide them until enabled. - The blocked-option error should explicitly say the option is recognized but disabled by admin setting or policy.
- Or
--no-proxyshould have a lower-friction escape path than arbitrary--proxy, while still respecting Group Policy.
Actual behavior
The option appears as a normal supported command-line option in help, but the command exits with an admin-setting gate before execution.
Source-level triage
Local checkout: microsoft/winget-cli at 5eb96e8.
Relevant paths:
src/AppInstallerCLICore/Argument.cpp- maps
Proxyto--proxy - maps
NoProxyto--no-proxy - appends both as common args
- gates both behind
ProxyCommandLineOptions
- maps
src/AppInstallerCLICore/Command.cpp- validates all command/common args
- throws disabled policy / admin setting messages
src/AppInstallerCommonCore/AdminSettings.cppProxyCommandLineOptionsdefaults tofalse
src/AppInstallerSharedLib/GroupPolicy.cpp- maps
EnableWindowsPackageManagerProxyCommandLineOptions
- maps
src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw- contains help text and admin-enable error text
doc/specs/#190 - Proxy Support.md- says
--no-proxydisables a default proxy - also says both args are disabled by default and must be enabled by admin
- says
Suggested fix direction
Smallest UX fix:
- Update help text for
--proxyand--no-proxyto mention that they requireProxyCommandLineOptions. - Improve the admin-setting error to say which option was blocked and whether the block came from admin setting vs Group Policy.
Larger design option:
- Split arbitrary proxy selection from proxy bypass.
- Keep arbitrary
--proxygated. - Consider allowing
--no-proxyby default unless an enterprise policy explicitly enforces proxy use.
Related issues / PRs
- #6090: proxy support for non-admin users, under admin supervision
- #6219: system proxy support
- #4152: proxy support spec
- #4203: proxy support implementation
This issue is intentionally scoped to help/error UX and recovery clarity. It is not asking for broad non-admin proxy control in the same issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Proxy and NoProxy argument mappings and policy gates in src/AppInstallerCLICore/Argument.cpp and Command.cpp, then inspect the related strings in src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw. Run the documented help and --no-proxy commands to verify the result. Done means help and the blocked-option error clearly communicate the ProxyCommandLineOptions requirement and the relevant option.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100