autocommit

package
v1.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 6 Imported by: 0

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

func NewClipboard

func NewClipboard() Clipboard

NewClipboard creates a new instance of Clipboard.

type ClipboardCommand

type ClipboardCommand interface {
	Execute(message string) error
}

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

type PostCommitCli interface {
	// Execute executes the post commit CLI.
	Execute() (string, error)
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL