Skip to content

Commit 53dedee

Browse files
committed
add: changes
1 parent 4b3e263 commit 53dedee

3 files changed

Lines changed: 44 additions & 10 deletions

File tree

cmd/apply.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ import (
1010

1111
var 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 == "" {

cmd/new.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,15 @@ func RunInteractiveWizard() (*ProjectInput, error) {
6868
// newCmd represents the new command
6969
var 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

cmd/root.go

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,47 @@
11
/*
2-
Copyright © 2025 Saurav Upadhyay sauravup041103@gmail.com
2+
Copyright © 2025 Saurav Upadhyay
33
*/
44
package cmd
55

66
import (
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+
1319
var 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

1932
func Execute() {
20-
err := rootCmd.Execute()
21-
if err != nil {
33+
if err := rootCmd.Execute(); err != nil {
2234
os.Exit(1)
2335
}
2436
}
2537

2638
func init() {
27-
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
39+
rootCmd.SetVersionTemplate(
40+
fmt.Sprintf(
41+
"bootstrap-cli %s\nCommit: %s\nBuilt: %s\n",
42+
Version,
43+
Commit,
44+
Date,
45+
),
46+
)
2847
}

0 commit comments

Comments
 (0)