message

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

cmd/craft/message/message.go

Index

Constants

This section is empty.

Variables

View Source
var MessageCmd = &cobra.Command{
	Use:     "message",
	Aliases: []string{"commit", "msg"},
	Short:   "Generates a suggested 'factory commit' command.",
	RunE: func(cmd *cobra.Command, args []string) error {
		presenter := ui.NewPresenter(cmd.OutOrStdout(), cmd.ErrOrStderr())
		ctx := cmd.Context()

		presenter.Summary("Crafting a commit message...")

		stagedDiff, _, err := globals.ExecClient.CaptureOutput(ctx, ".", "git", "diff", "--staged")
		if err != nil {
			return err
		}

		if strings.TrimSpace(stagedDiff) == "" {
			presenter.Info("No staged changes found to generate a commit message from.")
			presenter.Advice("Please stage your changes using 'git add' first.")
			return nil
		}

		presenter.Info("AI analysis complete. Suggested command:")
		presenter.Newline()

		simulatedSubject := "feat(craft): add placeholder for message generation"
		simulatedBody := "This change introduces the 'craft message' command but uses a hardcoded placeholder for the AI-generated commit message. The real implementation will call an LLM."

		fmt.Fprintf(presenter.Out(), "contextvibes factory commit -m \"%s\" -m \"%s\"\n", simulatedSubject, simulatedBody)

		return nil
	},
}

MessageCmd represents the craft message command

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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