minder
minder copied to clipboard
Implement the ability to persist values in the minder CLI config file
Details: At the moment a user can leverage config files to create different contexts for the minder CLI works on. For example, one can set a project ID that would be used across all calls (unless it's set explicitly via an env var or a flag, then viper uses them instead of what's in the config).
This should allow the user to persist values in the config file through the minder CLI and not have to edit the config file manually.
Proposal:
For example, have something like - minder config set --project <project>
which persist the <project>
value on the current config file.
- If the config file is also specified, use it, otherwise use the default one.
- We should first try to look if there's such a config file and edit it accordingly, and if it's missing then create a blank one with the new value stored.
- In any case we don't want to overwrite or lose any other existing content unintentionally.
References:
- https://github.com/stacklok/minder/issues/1750
- https://github.com/spf13/viper?tab=readme-ov-file#writing-config-files