microsoft / microsoft/winget-cli

Help should indicate --proxy/--no-proxy require ProxyCommandLineOptions, or --no-proxy should have a lower-friction escape path

Open
#6,320 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Feature
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 --proxy and --no-proxy as requiring ProxyCommandLineOptions, 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-proxy should 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 Proxy to --proxy
    • maps NoProxy to --no-proxy
    • appends both as common args
    • gates both behind ProxyCommandLineOptions
  • src/AppInstallerCLICore/Command.cpp
    • validates all command/common args
    • throws disabled policy / admin setting messages
  • src/AppInstallerCommonCore/AdminSettings.cpp
    • ProxyCommandLineOptions defaults to false
  • src/AppInstallerSharedLib/GroupPolicy.cpp
    • maps EnableWindowsPackageManagerProxyCommandLineOptions
  • src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw
    • contains help text and admin-enable error text
  • doc/specs/#190 - Proxy Support.md
    • says --no-proxy disables a default proxy
    • also says both args are disabled by default and must be enabled by admin
Suggested fix direction

Smallest UX fix:

  • Update help text for --proxy and --no-proxy to mention that they require ProxyCommandLineOptions.
  • 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 --proxy gated.
  • Consider allowing --no-proxy by 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.