pull-pal/cmd/list-issues.go
Moby von Briesen 10c77854a9 Create "local git client" and "openai client"
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
2023-04-25 20:32:08 -04:00

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)
}