mirror of
https://github.com/Pull-Pal/pull-pal.git
synced 2024-11-03 01:38:33 -04:00
10c77854a9
OpenAIClient can be used to interact with OpenAI's API. Untested at the moment (except with an API key that does not yet have perms) Local git client splits the "git" functionality (e.g. make commits, checkout branches, etc...) away from the "github" client I also removed a lot of duplicate code for the different commands in cmd And created a basic "local issue" command to send a "code change request" to the llm, and receive a code change response. Eventually, I want this to make the corresponding local git changes, for the user to check. TODO: github client should only be responsible for github-specific actions, e.g. opening a PR or listing issues/comments
44 lines
992 B
Go
44 lines
992 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/mobyvb/pull-pal/vc"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var localIssueCmd = &cobra.Command{
|
|
Use: "local-issue",
|
|
Short: "Processes a locally-defined/provided issue rather than remotely reading one from the Github repo",
|
|
// TODO csv filepath as arg?
|
|
// Args: cobra.ExactArgs(1),
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
cfg := getConfig()
|
|
|
|
p, err := getPullPal(cmd.Context(), cfg)
|
|
if err != nil {
|
|
fmt.Println("error creating new pull pal", err)
|
|
return
|
|
}
|
|
fmt.Println("Successfully initialized pull pal")
|
|
|
|
newIssue := vc.Issue{
|
|
Subject: "a few updates",
|
|
Body: "Add a quote from Frodo to the README.md and index.html files.\nSwitch main.go to port 7777.\nFiles:index.html,README.md,main.go",
|
|
Author: vc.Author{
|
|
Handle: "mobyvb",
|
|
},
|
|
}
|
|
err = p.MakeLocalChange(newIssue)
|
|
if err != nil {
|
|
fmt.Println("err making local change", err)
|
|
return
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(localIssueCmd)
|
|
}
|