kubectl-ai icon indicating copy to clipboard operation
kubectl-ai copied to clipboard

feat(cli): add "save-config" subcommand to store configuration

Open appleboy opened this issue 8 months ago • 5 comments

  • Added a new save-config subcommand to save the current configuration to the default config path.
  • Implemented the WriteConfigurationFile method to handle writing the configuration file.
  • Introduced the expandConfigPath helper function to process {CONFIG} and {HOME} placeholders in config paths.
  • Enhanced error handling and reporting for reading and writing configuration files.
  • Updated the Options struct to prevent certain fields (TracePath, ToolConfigPaths) from being marshaled into the config file.
  • Refactored LoadConfigurationFile to use expandConfigPath and provide clearer error messages.
  • Simplified the execution logic of the root command.

appleboy avatar May 17 '25 04:05 appleboy

@droot See 3e4b36d

appleboy avatar May 21 '25 06:05 appleboy

@droot All Done. Please help review again.

appleboy avatar May 31 '25 03:05 appleboy

@appleboy We recently added support for mcp and custom tools and that introduced two more configuration files that kubectl-ai takes input from. We are thinking of re-factoring the config stuff so that we can unify the config for kubectl-ai, custom-tools and mcp. So want to hold this PR for now til that refactor is done because being able to save adds another feature to consider.

We will get the PR in but there will be delay, hope you understand. Thank you!

droot avatar Jun 02 '25 20:06 droot

@droot Sounds Good. Thank you for getting back to me.

appleboy avatar Jun 03 '25 00:06 appleboy

@droot May I continue working on this pull request?

appleboy avatar Jul 03 '25 14:07 appleboy