middleware

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainParent added in v0.2.10

func ChainParent(checks ...CommandCheck) func(cmd *cobra.Command, args []string) error

ChainParent combines the parent command's PersistentPreRunE with additional checks This ensures child commands inherit parent middleware while adding their own All errors are returned without printing - error formatting is handled centrally in Execute()

func CheckLogin

func CheckLogin(cmd *cobra.Command, args []string) error

CheckLogin checks if the user is logged in and the session is valid

func CheckNodeInstalled added in v0.2.10

func CheckNodeInstalled(cmd *cobra.Command, args []string) error

CheckNodeInstalled checks if node is installed in the system path

func CheckPnpmInstalled

func CheckPnpmInstalled(cmd *cobra.Command, args []string) error

CheckPnpmInstalled checks if pnpm is installed in the system path

func Compose

func Compose(checks ...CommandCheck) func(cmd *cobra.Command, args []string) error

Compose combines multiple checks into a single function compatible with Cobra's PreRunE/PersistentPreRunE All errors are returned without printing - error formatting is handled centrally in Execute()

Types

type CommandCheck

type CommandCheck func(cmd *cobra.Command, args []string) error

CommandCheck is a function that performs a check before a command is run

func CheckNodeVersion

func CheckNodeVersion(minVersion string) CommandCheck

CheckNodeVersion checks if node is installed and meets the minimum version requirement

func CheckVersion added in v0.2.10

func CheckVersion(version string) CommandCheck

CheckVersion checks if the CLI version is up to date and handles upgrade prompts

Jump to

Keyboard shortcuts

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