redhat-et / copilot-ops

copilot-ops is a CLI tool that boosts up any DevOps repo to a ninja level of Artificially Intelligent Ops Repo
Apache License 2.0
34 stars 13 forks source link

Configuration with viper #27

Closed guymguym closed 2 years ago

guymguym commented 2 years ago

Load config file using https://github.com/spf13/viper Merge .copilot-ops.yaml with .copilot-ops.local.yaml (if exists) So that we can define local credentials to open ai in a local gitignored config file.

I tested using the file .copilot-ops.yaml on the top of the repo that defines a fileset called examples. I added the openai config in .copilot-ops.local.yaml so it stays local:

openai:
  apikey: sk-...
  orgid: org-...

Then could run without any additional enviroment variables set:

./copilot-ops patch -s examples -r "Add mysql env to the config map in stock-data.yaml"

Signed-off-by: Guy Margalit guymguym@gmail.com