delegator

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 8 Imported by: 0

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

View Source
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

func Delegate(args []string) error

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

func ShouldDelegate(args []string) bool

ShouldDelegate returns true if the command should be delegated to the project's CLI (cmd/velocity/main.go).

Types

This section is empty.

Jump to

Keyboard shortcuts

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