Documentation
¶
Overview ¶
Package delegator handles delegation from global CLI to project CLI. When running commands inside a Velocity project, the global CLI delegates to `go run ./cmd/velocity` (or cached binary) so the project's CLI has access to migrations and other project-specific code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var GlobalCommands = map[string]bool{ "new": true, "init": true, "upgrade": true, "self-update": true, "help": true, "--help": true, "-h": true, "version": true, "--version": true, "-v": true, "config": true, }
GlobalCommands are commands that should NOT be delegated. These run in the global CLI context.
Functions ¶
func CheckVersionMismatch ¶
func CheckVersionMismatch(globalVersion string)
CheckVersionMismatch warns if global CLI version differs from project's cli package version. Shows upgrade hint once per session.
func Delegate ¶
Delegate runs the command via the project's CLI. It first checks for a cached binary, rebuilding if necessary.
func GetProjectCLIVersion ¶ added in v0.7.0
func GetProjectCLIVersion() string
GetProjectCLIVersion returns the velocity-cli version from go.mod (exported for upgrade command)
func ShouldDelegate ¶
ShouldDelegate returns true if the command should be delegated to the project's CLI (cmd/velocity/main.go).
Types ¶
This section is empty.