Documentation
¶
Index ¶
Constants ¶
View Source
const Version = "0.1.4"
Version is the CLI version - single source of truth
Variables ¶
View Source
var ConfigCmd = &cobra.Command{
Use: "config",
Short: "Manage global CLI configuration",
Long: `Set, get, list, or reset global configuration defaults for velocity commands.`,
}
View Source
var InitCmd = &cobra.Command{
Use: "init",
Short: "Initialize Velocity in existing Go project",
Long: `Add Velocity framework structure to an existing Go project while preserving all existing files.`,
RunE: runInit,
}
View Source
var KeyCmd = &cobra.Command{
Use: "key:generate",
Short: "Generate a new application crypto key",
Long: "Generate a new 32-byte base64 encoded key and optionally update .env file",
Run: runKeyGenerate,
}
View Source
var NewCmd = &cobra.Command{ Use: "new [project-name]", Short: "Create a new Velocity project", Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { projectName := args[0] config := generator.ProjectConfig{ Name: projectName, Module: projectName, Database: database, Cache: cache, Auth: auth, API: api, } if err := generator.CreateProject(config); err != nil { fmt.Printf("\nError creating project: %v\n", err) return } // Show success message const ( colorReset = "\033[0m" colorGreen = "\033[32m" colorCyan = "\033[36m" colorBlue = "\033[34m" bold = "\033[1m" underline = "\033[4m" ) fmt.Println() fmt.Printf("\n%s %s\n", bold+underline+colorGreen+"SUCCESS"+colorReset, "Project created successfully!") fmt.Println() fmt.Printf("%s %s\n\n", bold+underline+colorBlue+"INFO"+colorReset, "Starting development servers") fmt.Println() generator.StartDevServers(projectName) }, }
View Source
var VersionCmd = &cobra.Command{ Use: "version", Short: "Print version information", Run: func(cmd *cobra.Command, args []string) { fmt.Println() fmt.Println(colors.BrandStyle.Render("╔══════════════════════════════════════╗")) fmt.Println(colors.BrandStyle.Render("║ VELOCITY CLI v" + Version + " ║")) fmt.Println(colors.BrandStyle.Render("╚══════════════════════════════════════╝")) fmt.Println() }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.