go-container/cmd/vm/cmd_vm.go
Snider a8e09bb03c feat: add cmd/vm from go-devops
LinuxKit VM management commands now live alongside the container
library they depend on. Registered via cli.RegisterCommands().

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-09 12:28:21 +00:00

42 lines
924 B
Go

// Package vm provides LinuxKit VM management commands.
package vm
import (
"forge.lthn.ai/core/cli/pkg/cli"
"forge.lthn.ai/core/go-i18n"
)
func init() {
cli.RegisterCommands(AddVMCommands)
}
// Style aliases from shared
var (
repoNameStyle = cli.RepoStyle
successStyle = cli.SuccessStyle
errorStyle = cli.ErrorStyle
dimStyle = cli.DimStyle
)
// VM-specific styles
var (
varStyle = cli.NewStyle().Foreground(cli.ColourAmber500)
defaultStyle = cli.NewStyle().Foreground(cli.ColourGray500).Italic()
)
// AddVMCommands adds container-related commands under 'vm' to the CLI.
func AddVMCommands(root *cli.Command) {
vmCmd := &cli.Command{
Use: "vm",
Short: i18n.T("cmd.vm.short"),
Long: i18n.T("cmd.vm.long"),
}
root.AddCommand(vmCmd)
addVMRunCommand(vmCmd)
addVMPsCommand(vmCmd)
addVMStopCommand(vmCmd)
addVMLogsCommand(vmCmd)
addVMExecCommand(vmCmd)
addVMTemplatesCommand(vmCmd)
}