Skip to content

Add ability to clear all configuration settings #133

@bhouston

Description

@bhouston

Add ability to clear all configuration settings

Description

Currently, the CLI tool supports clearing individual configuration settings with mycoder config clear <key>, but there is no way to clear all settings at once. This would be useful for users who want to reset their configuration to defaults.

Proposed Implementation

  1. Extend the config.ts command to add a new option to clear all settings
  2. Update the help text to include the new option
  3. Implement the functionality to delete all custom settings from the config file

Specific Changes

  1. In packages/cli/src/commands/config.ts:

    • Add a new option for the clear command (e.g., --all or using a special keyword like all)
    • Update the command description and examples
    • Add validation to check for the "all" option
    • Implement logic to clear all settings when the option is provided
  2. In packages/cli/src/settings/config.ts:

    • Add a function to reset the config file to an empty object or delete it entirely
    • Ensure proper error handling for file operations

Expected Behavior

  • When a user runs mycoder config clear --all (or similar command), all custom settings should be removed
  • The CLI should fall back to default values for all settings
  • The user should receive a confirmation message that all settings have been cleared

Additional Considerations

  • Should there be a confirmation prompt before clearing all settings?
  • Should we keep a backup of the cleared configuration?
  • Should we just delete the config file or replace it with an empty object?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions