@@ -14,6 +14,16 @@ var rootCmd = &cobra.Command{
1414 Use : "commit" ,
1515 Short : "CLI tool to write commit message" ,
1616 Long : `Write a commit message with AI of your choice` ,
17+ Example : `
18+ # Generate a commit message and run the interactive review flow
19+ commit .
20+
21+ # Preview what would be sent to the LLM without making an API call
22+ commit . --dry-run
23+
24+ # Generate a commit message and automatically commit it
25+ commit . --auto
26+ ` ,
1727 // Uncomment the following line if your bare application
1828 // has an action associated with it:
1929 // Run: func(cmd *cobra.Command, args []string) { },
@@ -78,11 +88,9 @@ func init() {
7888 // when this action is called directly.
7989 rootCmd .Flags ().BoolP ("toggle" , "t" , false , "Help message for toggle" )
8090
81- // Add --dry-run flag to the commit command
82- creatCommitMsg .Flags ().Bool ("dry-run" , false , "Preview the prompt that would be sent to the LLM without making an API call" )
83-
84- // Add --auto flag to the commid command
85- creatCommitMsg .Flags ().Bool ("auto" , false , "Automatically commit with the generated message" )
91+ // Add --dry-run and --auto as persistent flags so they show in top-level help
92+ rootCmd .PersistentFlags ().Bool ("dry-run" , false , "Preview the prompt that would be sent to the LLM without making an API call" )
93+ rootCmd .PersistentFlags ().Bool ("auto" , false , "Automatically commit with the generated message" )
8694
8795 rootCmd .AddCommand (creatCommitMsg )
8896 rootCmd .AddCommand (llmCmd )
0 commit comments