cli/cmd/pkgcmd/cmd_pkg.go
Snider 7303ba6f23
Some checks failed
Deploy / build (push) Failing after 4s
Security Scan / security (push) Successful in 18s
refactor: register commands through Core framework lifecycle
Replace init() + cli.RegisterCommands() with cli.WithCommands() passed
to cli.Main(). Commands now register as framework services and receive
the root command during OnStartup — no global state, no blank imports.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 22:08:01 +00:00

35 lines
878 B
Go

// Package pkgcmd provides package management commands for core-* repos.
package pkgcmd
import (
"forge.lthn.ai/core/go/pkg/cli"
"forge.lthn.ai/core/go/pkg/i18n"
"github.com/spf13/cobra"
)
// Style and utility aliases
var (
repoNameStyle = cli.RepoStyle
successStyle = cli.SuccessStyle
errorStyle = cli.ErrorStyle
dimStyle = cli.DimStyle
ghAuthenticated = cli.GhAuthenticated
gitClone = cli.GitClone
)
// AddPkgCommands adds the 'pkg' command and subcommands for package management.
func AddPkgCommands(root *cobra.Command) {
pkgCmd := &cobra.Command{
Use: "pkg",
Short: i18n.T("cmd.pkg.short"),
Long: i18n.T("cmd.pkg.long"),
}
root.AddCommand(pkgCmd)
addPkgSearchCommand(pkgCmd)
addPkgInstallCommand(pkgCmd)
addPkgListCommand(pkgCmd)
addPkgUpdateCommand(pkgCmd)
addPkgOutdatedCommand(pkgCmd)
addPkgRemoveCommand(pkgCmd)
}