cmd

package
v0.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "0.3.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 {
			ui.Error("Error creating project: " + err.Error())
			return
		}

		ui.Newline()
		ui.Success("Project created successfully!")
		ui.Newline()
		ui.Info("Starting development servers")
		ui.Newline()

		generator.StartDevServers(projectName)
	},
}
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

func InitHelp

func InitHelp(root *cobra.Command)

InitHelp sets up custom help for the root command

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL