Documentation
¶
Index ¶
Constants ¶
View Source
const Version = "0.7.1"
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", SilenceUsage: true, SilenceErrors: true, Args: func(cmd *cobra.Command, args []string) error { if len(args) < 1 { ui.Error("Project name is required") ui.Newline() ui.Muted("Usage: velocity new [project-name]") ui.Newline() ui.Muted("Flags:") ui.Muted(" --database Database driver (postgres, mysql, sqlite)") ui.Muted(" --cache Cache driver (redis, memory)") ui.Muted(" --auth Include authentication scaffolding") ui.Muted(" --api API-only structure (no views)") return fmt.Errorf("") } return nil }, Run: func(cmd *cobra.Command, args []string) { projectName := args[0] ui.Header("velocity new") config := generator.ProjectConfig{ Name: projectName, Module: projectName, Database: database, Cache: cache, Auth: auth, API: api, } if err := generator.CreateProject(config); err != nil { ui.Newline() ui.Error(err.Error()) return } ui.Newline() ui.Info("Starting development servers") generator.StartDevServers(projectName) }, }
View Source
var UpgradeCmd = &cobra.Command{
Use: "upgrade",
Short: "Update project's velocity-cli to match global CLI version",
Long: `Updates the velocity-cli dependency in your project's go.mod to match the globally installed CLI version.`,
RunE: runUpgrade,
}
UpgradeCmd updates the project's velocity-cli dependency to match the global CLI version
View Source
var VersionCmd = &cobra.Command{ Use: "version", Short: "Print version information", Run: func(cmd *cobra.Command, args []string) { w := cmd.OutOrStdout() fmt.Fprintln(w) fmt.Fprintln(w, colors.BrandStyle.Render("╔══════════════════════════════════════╗")) fmt.Fprintln(w, colors.BrandStyle.Render("║ VELOCITY CLI v"+Version+" ║")) fmt.Fprintln(w, colors.BrandStyle.Render("╚══════════════════════════════════════╝")) fmt.Fprintln(w) }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.