Skip to content

Implement modular config system and curses TUI #26

@davidgantman

Description

@davidgantman

Goal

Introduce a persistent YAML-based configuration system and a modular curses-based text UI into PatchWise.
The config system and TUI will be independent modules, designed so either can be replaced without impacting the other.


High-level plan

  1. Foundation:

    • Implement a YAML-based config loader in patchwise/utils/config.py.
    • Support loading defaults from default_config.yaml and overlaying with user_config.yaml.
    • No TUI or curses dependencies at this stage.
  2. Config options (phase 1):

    • Start with a log_level option in default_config.yaml set to "INFO".
    • Allow user overrides via user_config.yaml.
    • Ensure --log-level CLI flag takes precedence over both configs.
  3. Config options (phase 2):

    • Add an api_key_disclaimer section to the default config.
    • No prompting yet — this is just config storage and merging.
  4. UI abstraction:

    • Create a standalone curses module in patchwise/utils/curses.py.
    • Must be generic, accepting message and options as arguments and returning a user choice.
    • No direct config file access in this module.
  5. Integration:

    • Update main.py to read config at startup, decide when to prompt, and dynamically import curses only if needed.
  6. Interactive config editor:

    • Implement patchwise --config to launch a menuconfig-style interface for editing user config values.
    • Display the merged (overlaid) config state — defaults overlaid with user values — and write changes back only to user_config.yaml.

Expected outcome

  • PatchWise will have a robust, file-based configuration system.
  • The curses TUI will be modular and swappable.
  • Config values will be respected across runs and adjustable through both file edits and an interactive CLI.

Sub-issues

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions