mirror of
https://github.com/Pull-Pal/pull-pal.git
synced 2024-11-14 00:08:25 -05: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
35 lines
730 B
Go
35 lines
730 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var listIssuesCmd = &cobra.Command{
|
|
Use: "list-issues",
|
|
Short: "Lists github issues meeting the configured criteria",
|
|
Long: "Lists github issues meeting the configured criteria",
|
|
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")
|
|
|
|
issueList, err := p.ListIssues(cfg.usersToListenTo, cfg.requiredIssueLabels)
|
|
if err != nil {
|
|
fmt.Println("error listing issues", err)
|
|
return
|
|
}
|
|
fmt.Println(issueList)
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(listIssuesCmd)
|
|
}
|