Documentation ¶
Index ¶
Constants ¶
View Source
const SystemMsg = `` /* 2349-byte string literal not displayed */
SystemMsg is the message that will feed the OpenAI API to generate the commit message.
Variables ¶
View Source
var ( CommitChangesOption = fmt.Sprintf("%-2s Commit changes", "💾") RegenerateOption = fmt.Sprintf("%-2s Regenerate", "🔄") CopyToClipboardOption = fmt.Sprintf("%-2s Copy to clipboard", "📋") AddInstructionOption = fmt.Sprintf("%-4s Add instruction", "✏️") ExitOption = fmt.Sprintf("%-2s Exit", "🚪") )
Functions ¶
This section is empty.
Types ¶
type AddInstructionCli ¶ added in v1.4.3
type AddInstructionCli interface { // Execute executes the add instruction CLI. Execute() (string, error) }
AddInstructionCli is an interface for executing add instruction CLI operations.
func MakeAddInstructionCli ¶ added in v1.4.3
func MakeAddInstructionCli() AddInstructionCli
func NewAddInstructionCli ¶ added in v1.4.3
func NewAddInstructionCli() AddInstructionCli
NewAddInstructionCli creates a new instance of AddInstructionCli.
type AddInstructionCommand ¶ added in v1.4.3
type AddInstructionCommand interface {
Execute(config *openai.Config, instruction string) (string, error)
}
func MakeAddInstructionCommand ¶ added in v1.4.3
func MakeAddInstructionCommand() AddInstructionCommand
func NewAddInstructionCommand ¶ added in v1.4.3
func NewAddInstructionCommand( chatCommand openai.ChatCommand, ) AddInstructionCommand
type Clipboard ¶
type Clipboard interface { // Copy copies the given message to the clipboard. Copy(message string) error }
Clipboard is an interface that defines the Copy method.
func MakeClipboard ¶
func MakeClipboard() Clipboard
type ClipboardCommand ¶
func MakeClipboardCommand ¶
func MakeClipboardCommand() ClipboardCommand
func NewClipboardCommand ¶
func NewClipboardCommand(clipboard Clipboard) ClipboardCommand
type GeneratorCommand ¶
type GeneratorCommand interface { // Execute returns the commit message generated by OpenAI. Execute(config *openai.Config) (string, error) }
GeneratorCommand is the interface that wraps the Execute method.
func MakeGeneratorCommand ¶
func MakeGeneratorCommand() GeneratorCommand
func NewGeneratorCommand ¶
func NewGeneratorCommand( chatCommand openai.ChatCommand, diffCommand git.DiffCommand, ) GeneratorCommand
NewGeneratorCommand creates a new instance of GeneratorCommand.
type PostCommitCli ¶
PostCommitCli is an interface for executing post commit CLI operations.
func MakePostCommitCli ¶
func MakePostCommitCli() PostCommitCli
func NewPostCommitCli ¶
func NewPostCommitCli() PostCommitCli
NewPostCommitCli creates a new instance of PostCommitCli.
Click to show internal directories.
Click to hide internal directories.