Skip to content

Enhance CLI Config Command with 'clear' Option and Default Value Indicators #117

@bhouston

Description

@bhouston

Enhance CLI Config Command with 'clear' Option and Default Value Indicators

Description

The current CLI tool has the ability to list and set configuration options, but it is missing two important features:

  1. Clear Option: Users cannot currently clear (reset to default) a specific configuration option without manually editing the config file.
  2. Default Value Indicators: When listing configuration options, the CLI doesn't indicate which values are using defaults because they are not explicitly set.

These enhancements would improve user experience by providing more complete configuration management and better visibility into the configuration state.

Proposed Changes

Add a 'clear' Command

Add a new clear subcommand to the config command that allows users to reset a specific configuration option to its default value:

# Reset a specific configuration option to its default value
mycoder config clear <key>

# Example
mycoder config clear customPrompt

Enhance 'list' Command

Modify the list command to indicate which configuration options are using default values:

# Current output example
$ mycoder config list
Current configuration:
  githubMode: false
  headless: true
  userSession: false
  ...

# Proposed output example
$ mycoder config list
Current configuration:
  githubMode: false (default)
  headless: true (default)
  userSession: false (default)
  modelProvider: openai (custom)
  modelName: gpt-4o-2024-05-13 (custom)
  ...

Implementation Notes

  1. The clear command should:

    • Accept a key parameter
    • Remove the key from the config file
    • Show the default value that will now be used
    • Handle errors for invalid keys
  2. The enhanced list command should:

    • Compare each key-value pair with the default configuration
    • Indicate which values are defaults vs. custom-set
    • Use color coding or formatting to distinguish between them

Documentation

  • Update README.md to document the new clear command
  • Update examples in the code and documentation

Acceptance Criteria

  • Users can reset individual config options to defaults with mycoder config clear <key>
  • The list command shows which values are defaults and which are custom
  • Documentation is updated to reflect these changes
  • Existing functionality continues to work as expected

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