Skip to content

feat(cli): add --reset flag with confirmation prompt to protostar config - #123

Merged
JacksonFergusonDev merged 1 commit into
mainfrom
feat/add-reset-flag
Jul 31, 2026
Merged

feat(cli): add --reset flag with confirmation prompt to protostar config#123
JacksonFergusonDev merged 1 commit into
mainfrom
feat/add-reset-flag

Conversation

@JacksonFergusonDev

Copy link
Copy Markdown
Owner

Description

Adds a --reset flag to the protostar config command, 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 / --force flag is also added to allow non-interactive/scripted bypass of the confirmation prompt.

Proposed Changes

src/protostar/cli.py

  • Added -f/--force and --reset flags to the config subcommand parser.
  • Added interactive questionary.confirm confirmation prompt to handle_config.
  • Overwrites CONFIG_FILE with DEFAULT_CONFIG_CONTENT when confirmed or when --force is supplied.

tests/test_cli.py

  • Added test_handle_config_reset_confirmed: Verifies reset when user confirms prompt.
  • Added test_handle_config_reset_cancelled: Verifies reset is aborted when user declines prompt.
  • Added test_handle_config_reset_force: Verifies reset bypasses prompt when --force is passed.
  • Added test_build_parser_config_reset: Verifies parser flags.

@JacksonFergusonDev JacksonFergusonDev changed the title feat(cli): add --reset flag with confirmation prompt to `protostar … feat(cli): add --reset flag with confirmation prompt to protostar config Jul 31, 2026
…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
JacksonFergusonDev merged commit 86242d3 into main Jul 31, 2026
10 checks passed
@JacksonFergusonDev
JacksonFergusonDev deleted the feat/add-reset-flag branch July 31, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant