CLI that turns LLM input into well-formatted Conventional Commits
0

Configure Feed

Select the types of activity you want to include in your feed.

docs: improve CLI examples and make flags optional

Co-authored-by: Crush <crush@charm.land>

Amolith (Oct 21, 2025, 7:23 PM -0600) af690d65 2fa4412d

+20 -4
+20 -4
main.go
··· 24 24 Long: `formatted-commit helps you create well-formatted Git commits that follow 25 25 the Conventional Commits specification with proper subject length validation, 26 26 body wrapping, and trailer formatting.`, 27 + Example: ` 28 + # With co-author 29 + formatted-commit -t feat -m "do a thing" -T "Crush <crush@charm.land>" 30 + 31 + # Breaking change with longer body 32 + formatted-commit -t feat -m "do a thing that borks a thing" -B "$(cat <<'EOF' 33 + Multi-line 34 + - Body 35 + - Here 36 + 37 + This is what borked because of new shiny, this is how migrate 38 + EOF 39 + )" 40 + 41 + # Including scope for more precise changes 42 + formatted-commit -t refactor -s "web/git-bug" -m "fancy shmancy" \ 43 + -b "Had to do a weird thing because..." 44 + `, 27 45 RunE: func(cmd *cobra.Command, args []string) error { 28 46 // TODO: Implement commit formatting logic here 29 47 // 1. Validate subject length (type(scope): message <= 50 chars) ··· 38 56 func init() { 39 57 rootCmd.Flags().StringVarP(&commitType, "type", "t", "", "commit type (required)") 40 58 rootCmd.Flags().StringVarP(&message, "message", "m", "", "commit message (required)") 41 - rootCmd.Flags().StringSliceVarP(&trailers, "trailer", "T", []string{}, "trailer in 'Key: value' format (required, repeatable)") 42 - rootCmd.Flags().StringVarP(&body, "body", "b", "", "commit body (required)") 59 + rootCmd.Flags().StringSliceVarP(&trailers, "trailer", "T", []string{}, "trailer in 'Sentence-case-key: value' format (optional, repeatable)") 60 + rootCmd.Flags().StringVarP(&body, "body", "b", "", "commit body (optional)") 43 61 rootCmd.Flags().StringVarP(&scope, "scope", "s", "", "commit scope (optional)") 44 62 rootCmd.Flags().BoolVarP(&breakingChange, "breaking", "B", false, "mark as breaking change (optional)") 45 63 46 64 rootCmd.MarkFlagRequired("type") 47 65 rootCmd.MarkFlagRequired("message") 48 - rootCmd.MarkFlagRequired("trailer") 49 - rootCmd.MarkFlagRequired("body") 50 66 } 51 67 52 68 func main() {