chocolatey / chocolatey/choco

Provide ability to manage remembered arguments for a package

Open
#3,839 1 comment 2 reactions 0 assignees View on GitHub
0 - Backlog ClickUp - Backlog Enhancement
Dominant language
C#
Stars
11.5k
Forks
960
PR merge metrics
No merged PRs in 30d

Description

### Checklist

- [x] I have verified this is the correct repository for opening this issue.
- [x] I have verified no other issues exist related to my request.

### Is Your Feature Request Related To A Problem? Please describe.

In the current version of Chocolatey CLI, 2.6.0, when the [useRememberedArgumentsForUpgrades](https://docs.chocolatey.org/en-us/configuration/#userememberedargumentsforupgrades) feature is enabled, if you install a package using command line arguments, those command line arguments (if they are part of the collection of arguments that are allowed) are saved within a `.arguments` file, and then when the package is upgraded, these arguments are hydrated from the `.arguments` file, so that they don't need to be set at the command line each time a package is upgraded.

Currently, it is possible to "see" what command line arguments have been persisted for a given package, by using the `choco info` command, for example

```
choco info chocolatey-agent --local-only
```

which will show:

Image

However, this is the _only_ management of these arguments that can be done.

If you wanted to remove these arguments, so that they are not applied during the next upgrade, you would have to go into the `.chocolatey` folder, and find the `.arguments` file for the package you want to upgrade, and then delete the `.arguments` file.

This isn't ideal, as it relies on the end user having knowledge outwith the day to day running of Chocolatey CLI.

### Describe The Solution. Why is it needed?

The solution here would be to introduce another Chocolatey CLI command to allow the full management of remembered arguments for a package. This would include the sub-commands:

* list
* set
* unset

With this in place, the end user could then choose to:

* "see" the remembered arguments for a package
* reset the remembered arguments, without the need to go hunting for a `.arguments` file
* augment the remembered arguments, by adding additional arguments for the next upgrade

Due to the fact that the remembered arguments are encrypted within the `.arguments` file, it is not possible to manaully augment the arguments that have been saved for a given package.

The suggested command name for this functionailty would be `choco arguments`, but open to other suggestions here.

### Additional Context

The need for this feature came out of a discussion that was had internally on this [issue](https://gitlab.com/chocolatey/solutions/support-issues/-/issues/150), please refer to that for any additional context that might be required.

### Acceptance Criteria

* User is able to show the remembered arguments for a package using the `list` sub-command
* User is able to reset the remembered arguments for a package using the `unset` sub-command
* User is able to add/modify the remembered arguments for a package using the `set` sub-command
* User is _not_ able to change remembered arguments for anything other than the latest package version
* User no longer sees the remembered arguments when running the `choco info` command
* User is able to use the `-r` command line option to get a machine readable version of the remembered arguments

### Related Issues

_No response_

┆Issue is synchronized with this [Clickup task](https://app.clickup.com/t/868j27264) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Research direction

Start by tracing the existing `choco info --local-only` handling and how package `.arguments` files are read and encrypted. Define the `choco arguments` subcommands and their version restrictions against the acceptance criteria, including `-r` output; done means list, set, and unset work without displaying remembered arguments through `choco info`.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.