feat(cli): add --reset flag with confirmation prompt to protostar config - #123
Merged
Conversation
--reset flag with confirmation prompt to `protostar …--reset flag with confirmation prompt to protostar config
…config` Allows users to reset their global configuration file (~/.config/protostar/config.toml) to its default state via `protostar config --reset`. - Prompt user for confirmation before resetting existing configuration data. - Support `-f`/`--force` flag on `protostar config` to bypass confirmation prompt. - Add unit test suite in `tests/test_cli.py` covering prompt confirmation, cancellation, and force flag behavior.
JacksonFergusonDev
force-pushed
the
feat/add-reset-flag
branch
from
July 31, 2026 05:00
c79d0e1 to
630c6cd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
--resetflag to theprotostar configcommand, enabling users to reset their global Protostar configuration file (~/.config/protostar/config.toml) back to its default state.Before overwriting the file, Protostar prompts the user for confirmation (
Warning: this will erase your current configuration, are you sure you want to do this?). A-f/--forceflag is also added to allow non-interactive/scripted bypass of the confirmation prompt.Proposed Changes
src/protostar/cli.py-f/--forceand--resetflags to theconfigsubcommand parser.questionary.confirmconfirmation prompt tohandle_config.CONFIG_FILEwithDEFAULT_CONFIG_CONTENTwhen confirmed or when--forceis supplied.tests/test_cli.pytest_handle_config_reset_confirmed: Verifies reset when user confirms prompt.test_handle_config_reset_cancelled: Verifies reset is aborted when user declines prompt.test_handle_config_reset_force: Verifies reset bypasses prompt when--forceis passed.test_build_parser_config_reset: Verifies parser flags.