Skip to content

Commit 0f03547

Browse files
--dry-run flag added to commit command
1 parent 7dd4621 commit 0f03547

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cmd/cli/root.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ var creatCommitMsg = &cobra.Command{
5353
Use: ".",
5454
Short: "Create Commit Message",
5555
RunE: func(cmd *cobra.Command, args []string) error {
56-
CreateCommitMsg()
56+
dryRun, _ := cmd.Flags().GetBool("dry-run")
57+
CreateCommitMsg(dryRun)
5758
return nil
5859
},
5960
}
@@ -68,6 +69,10 @@ func init() {
6869
// Cobra also supports local flags, which will only run
6970
// when this action is called directly.
7071
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
72+
73+
// Add --dry-run flag to the commit command
74+
creatCommitMsg.Flags().Bool("dry-run", false, "Preview the prompt that would be sent to the LLM without making an API call")
75+
7176
rootCmd.AddCommand(creatCommitMsg)
7277
rootCmd.AddCommand(llmCmd)
7378
llmCmd.AddCommand(llmSetupCmd)

0 commit comments

Comments
 (0)