Documentation ¶
Index ¶
- func CheckGitPresence() bool
- func ErrCheck(err error)
- func ErrReturn(err error) error
- func FindDotGit(repoPath string) (path string, err error)
- func GitDiff(staged bool, args []string) string
- func ProceedEditor(title, target string) (string, error)
- func ProceedSelector(title string, choices []string) (string, error)
- func ShowVersion(version string)
- type Autommit
- func (a *Autommit) CheckForStagedFiles() (exist bool, fileNames []string)
- func (a *Autommit) CreateCompletionRequest(prompt string) (string, error)
- func (a *Autommit) GeneratePrompt(gitDiff string, footer string) string
- func (a *Autommit) GetOpenPGPKeyring() (err error)
- func (a *Autommit) GitAddDialogue()
- func (a *Autommit) GitCommit() error
- func (a *Autommit) GitCommitDialogue() (regenerate bool)
- func (a *Autommit) GitPush() error
- func (a *Autommit) NewOpenAiClient() *openai.Client
- func (a *Autommit) ParseStringAsJson(strSrc string) error
- func (a *Autommit) PopulateFileList() ([]string, error)
- func (a *Autommit) PopulateGitUserInfo() error
- func (a *Autommit) UnstageFiles() error
- type Commit
- type GitConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckGitPresence ¶
func CheckGitPresence() bool
func FindDotGit ¶
func ProceedEditor ¶
func ShowVersion ¶
func ShowVersion(version string)
Types ¶
type Autommit ¶
type Autommit struct { Version string OpenAiApiKey string Context context.Context OpenAiClient openai.Client PgpKeyPath string CommitInfo Commit Type string MaxChars int GitConfig GitConfig }
func NewAutommit ¶
func (*Autommit) CheckForStagedFiles ¶
CheckForStagedFiles checks if there are any staged files if there are, it will return true, and list them
func (*Autommit) CreateCompletionRequest ¶
func (*Autommit) GeneratePrompt ¶
function GeneratePrompt generates a prompt for the OpenAI API @param gitDiff string @param footer string @return string
func (*Autommit) GetOpenPGPKeyring ¶
func (*Autommit) GitAddDialogue ¶
func (a *Autommit) GitAddDialogue()
func GitAddDialogue will ask the user to select files to add to the commit if no files are available to select and no files are already staged, it will exit the program if no files are available to select but some files are already staged, it will proceed to the commit dialogue
func (*Autommit) GitCommitDialogue ¶
func GitCommitDialogue will walk the user through git the git commit dialogue and return a boolean indicating whether the commit message is accepted by the user or not if the user selects "regenerate", it will return false, prompting the program to regenerate the commit message
func (*Autommit) NewOpenAiClient ¶
func (*Autommit) ParseStringAsJson ¶
func (*Autommit) PopulateFileList ¶
PopulateFileList populates the file list for the add prompt selector
func (*Autommit) PopulateGitUserInfo ¶
func PopulateGitUserInfo() will parse a .gitconfig file and populate the Autommit struct with the user's name and email
func (*Autommit) UnstageFiles ¶
UnstageFiles unstages all files