2026-01-30 00:22:47 +00:00
|
|
|
// Package vm provides LinuxKit VM management commands.
|
|
|
|
|
package vm
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/charmbracelet/lipgloss"
|
2026-01-30 10:32:05 +00:00
|
|
|
"github.com/host-uk/core/pkg/cli"
|
feat(i18n): add translation keys to all CLI commands
Replace hardcoded strings with i18n.T() calls across all cmd/* packages:
- ai, build, ci, dev, docs, doctor, go, php, pkg, sdk, setup, test, vm
Adds 500+ translation keys to en.json for command descriptions,
flag descriptions, labels, messages, and error strings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 02:37:57 +00:00
|
|
|
"github.com/host-uk/core/pkg/i18n"
|
2026-01-30 00:47:54 +00:00
|
|
|
"github.com/spf13/cobra"
|
2026-01-30 00:22:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Style aliases from shared
|
|
|
|
|
var (
|
2026-01-30 10:32:05 +00:00
|
|
|
repoNameStyle = cli.RepoNameStyle
|
|
|
|
|
successStyle = cli.SuccessStyle
|
|
|
|
|
errorStyle = cli.ErrorStyle
|
|
|
|
|
dimStyle = cli.DimStyle
|
2026-01-30 00:22:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// VM-specific styles
|
|
|
|
|
var (
|
2026-01-30 10:32:05 +00:00
|
|
|
varStyle = lipgloss.NewStyle().Foreground(cli.ColourAmber500)
|
|
|
|
|
defaultStyle = lipgloss.NewStyle().Foreground(cli.ColourGray500).Italic(true)
|
2026-01-30 00:22:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// AddVMCommands adds container-related commands under 'vm' to the CLI.
|
2026-01-30 00:47:54 +00:00
|
|
|
func AddVMCommands(root *cobra.Command) {
|
|
|
|
|
vmCmd := &cobra.Command{
|
|
|
|
|
Use: "vm",
|
feat(i18n): add translation keys to all CLI commands
Replace hardcoded strings with i18n.T() calls across all cmd/* packages:
- ai, build, ci, dev, docs, doctor, go, php, pkg, sdk, setup, test, vm
Adds 500+ translation keys to en.json for command descriptions,
flag descriptions, labels, messages, and error strings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 02:37:57 +00:00
|
|
|
Short: i18n.T("cmd.vm.short"),
|
|
|
|
|
Long: i18n.T("cmd.vm.long"),
|
2026-01-30 00:47:54 +00:00
|
|
|
}
|
2026-01-30 00:22:47 +00:00
|
|
|
|
2026-01-30 00:47:54 +00:00
|
|
|
root.AddCommand(vmCmd)
|
2026-01-30 00:22:47 +00:00
|
|
|
addVMRunCommand(vmCmd)
|
|
|
|
|
addVMPsCommand(vmCmd)
|
|
|
|
|
addVMStopCommand(vmCmd)
|
|
|
|
|
addVMLogsCommand(vmCmd)
|
|
|
|
|
addVMExecCommand(vmCmd)
|
|
|
|
|
addVMTemplatesCommand(vmCmd)
|
|
|
|
|
}
|