chocolatey / chocolatey/choco

Inconsistent behaviour when using `--password`

Open
#3,542 0 comments 0 reactions 0 assignees View on GitHub
0 - Backlog Bug
Dominant language
C#
Stars
11.5k
Forks
960
PR merge metrics
No merged PRs in 30d

Description

### Checklist

- [x] I confirm there are no unresolved issues reported on the [Chocolatey Status page](https://status.chocolatey.org).
- [x] I have verified this is the correct repository for opening this issue.
- [x] I have verified no other issues exist related to my problem.
- [x] I have verified this is not an issue for a specific package.
- [x] I have verified this issue is not security related.
- [x] I confirm I am using **official**, and **not** unofficial, or modified, Chocolatey products.

### What You Are Seeing?

Many commands that support username and password will behave unexpectedly if you pass `-user anyValue -p`.

For instance:
- `install`: Outputs help, complains that a package name is required.
- `search`: Outputs help, prompts for a password.

There are possibly other commands effected.

### What is Expected?

Help shouldn't be output and commands should behave as expected and consistently.

### How Did You Get This To Happen?

1. `choco install cloudflared -u test -p`
2. This shows the install command help and complains that a package name is required: `Package name is required. Please pass at least one package name to install.`

1. `choco search cloudflared -u test -p`
2. This shows the search command help and prompts for a password: `User name 'test' provided. Password:`

### System Details

- Operating System: Windows 11
- Windows PowerShell Version: 7
- Chocolatey CLI Version: 2.3
- Chocolatey Licensed Extension version: 6.2.1
- Chocolatey License type (Professional / Business / ?): Business
- Terminal/Emulator: Windows Terminal

### Installed Packages

N/A

### Output Log

N/A

### Additional Context

- [Zendesk ticket](https://chocolatey.zendesk.com/agent/tickets/23990).

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported CLI entry points with `choco install cloudflared -u test -p` and `choco search cloudflared -u test -p` in Chocolatey CLI 2.3. Compare how each command handles the missing password and identify the other commands supporting username and password. Done means these commands behave consistently without incorrectly showing help or prompting unexpectedly, with regression coverage for the cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.