File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,15 @@ import (
1010
1111var applyCmd = cobra.Command {
1212 Use : "apply" ,
13- Short : "Apply project configuration from YAML" ,
13+ Short : "Create or update a project from a YAML configuration." ,
14+ Long : `Apply a declarative project configuration defined in a YAML file.
15+
16+ The YAML file acts as the source of truth for the project.
17+ BootstrapCLI will generate or update only tool-owned files
18+ based on this configuration.
19+
20+ This command is safe to run multiple times and is intended
21+ for long-lived projects and team environments.` ,
1422 Run : func (cmd * cobra.Command , args []string ) {
1523
1624 if yamlPath == "" {
Original file line number Diff line number Diff line change @@ -68,8 +68,15 @@ func RunInteractiveWizard() (*ProjectInput, error) {
6868// newCmd represents the new command
6969var newCmd = & cobra.Command {
7070 Use : "new" ,
71- Short : "command for creating a new project." ,
72- Long : `command for creating a new project.` ,
71+ Short : "Create a new Go project using CLI flags." ,
72+ Long : `Create a new Go project with a predefined structure
73+ and production-oriented defaults.
74+
75+ This command is intended for quick project initialization
76+ using CLI flags such as router, database, and port.
77+
78+ For reproducible or team-based workflows, consider using
79+ the YAML-based 'apply' command instead.` ,
7380 Run : func (cmd * cobra.Command , args []string ) {
7481 interactive , _ := cmd .Flags ().GetBool ("interactive" )
7582
Original file line number Diff line number Diff line change 11/*
2- Copyright © 2025 Saurav Upadhyay sauravup041103@gmail.com
2+ Copyright © 2025 Saurav Upadhyay
33*/
44package cmd
55
66import (
7+ "fmt"
78 "os"
89
910 "github.com/spf13/cobra"
1011)
1112
12- // rootCmd represents the base command when called without any subcommands
13+ var (
14+ Version = "dev"
15+ Commit = "none"
16+ Date = "unknown"
17+ )
18+
1319var rootCmd = & cobra.Command {
1420 Use : "bootstrap" ,
15- Short : "CLI project for building building your golang project faster." ,
16- Long : `CLI project for building building your golang project faster.` ,
21+ Short : "Scaffold and manage production-ready Go services." ,
22+ Long : `BootstrapCLI is a project lifecycle tool for Go services,
23+ It helps you create, configure, and evolve Go projects using
24+ opinionated defaults, a clear project structure, and
25+ declarative configuration.` ,
26+ Version : Version ,
27+ Run : func (cmd * cobra.Command , args []string ) {
28+ _ = cmd .Help ()
29+ },
1730}
1831
1932func Execute () {
20- err := rootCmd .Execute ()
21- if err != nil {
33+ if err := rootCmd .Execute (); err != nil {
2234 os .Exit (1 )
2335 }
2436}
2537
2638func init () {
27- rootCmd .Flags ().BoolP ("toggle" , "t" , false , "Help message for toggle" )
39+ rootCmd .SetVersionTemplate (
40+ fmt .Sprintf (
41+ "bootstrap-cli %s\n Commit: %s\n Built: %s\n " ,
42+ Version ,
43+ Commit ,
44+ Date ,
45+ ),
46+ )
2847}
You can’t perform that action at this time.
0 commit comments