You can use my open source tool aider from the cli. It is integrated with your local git repo and commits each change from the AI.
Right now only GPT-3.5 and GPT-4 seem to be capable of this sort of "code editing" task. But aider has support for connecting to other/local LLMs and an active community of folks experimenting with them.