refactor(cli): restructure cmd packages into subdirectories
- Move CLI commands into subdirectories matching command hierarchy:
dev/, go/, php/, build/, ci/, sdk/, pkg/, vm/, docs/, setup/, doctor/, test/, ai/
- Create shared/ package for common styles and utilities
- Add new `core ai` root command with claude subcommand
- Update package declarations and imports across all files
- Create commands.go entry points for each package
- Remove GUI-related files (moved to core-gui repo)
This makes the filesystem structure match the CLI command structure,
improving context capture and code organization.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 18:02:43 +00:00
|
|
|
// Package pkg provides package management commands for core-* repos.
|
|
|
|
|
package pkg
|
2026-01-29 11:42:22 +00:00
|
|
|
|
|
|
|
|
import (
|
2026-01-29 18:13:51 +00:00
|
|
|
"github.com/host-uk/core/cmd/shared"
|
2026-01-29 11:42:22 +00:00
|
|
|
"github.com/leaanthony/clir"
|
|
|
|
|
)
|
|
|
|
|
|
refactor(cli): restructure cmd packages into subdirectories
- Move CLI commands into subdirectories matching command hierarchy:
dev/, go/, php/, build/, ci/, sdk/, pkg/, vm/, docs/, setup/, doctor/, test/, ai/
- Create shared/ package for common styles and utilities
- Add new `core ai` root command with claude subcommand
- Update package declarations and imports across all files
- Create commands.go entry points for each package
- Remove GUI-related files (moved to core-gui repo)
This makes the filesystem structure match the CLI command structure,
improving context capture and code organization.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 18:02:43 +00:00
|
|
|
// Style and utility aliases
|
|
|
|
|
var (
|
|
|
|
|
repoNameStyle = shared.RepoNameStyle
|
|
|
|
|
successStyle = shared.SuccessStyle
|
|
|
|
|
errorStyle = shared.ErrorStyle
|
|
|
|
|
dimStyle = shared.DimStyle
|
|
|
|
|
ghAuthenticated = shared.GhAuthenticated
|
|
|
|
|
gitClone = shared.GitClone
|
|
|
|
|
)
|
|
|
|
|
|
2026-01-29 11:42:22 +00:00
|
|
|
// AddPkgCommands adds the 'pkg' command and subcommands for package management.
|
|
|
|
|
func AddPkgCommands(parent *clir.Cli) {
|
|
|
|
|
pkgCmd := parent.NewSubCommand("pkg", "Package management for core-* repos")
|
|
|
|
|
pkgCmd.LongDescription("Manage host-uk/core-* packages and repositories.\n\n" +
|
|
|
|
|
"Commands:\n" +
|
|
|
|
|
" search Search GitHub for packages\n" +
|
|
|
|
|
" install Clone a package from GitHub\n" +
|
|
|
|
|
" list List installed packages\n" +
|
|
|
|
|
" update Update installed packages\n" +
|
|
|
|
|
" outdated Check for outdated packages")
|
|
|
|
|
|
|
|
|
|
addPkgSearchCommand(pkgCmd)
|
|
|
|
|
addPkgInstallCommand(pkgCmd)
|
|
|
|
|
addPkgListCommand(pkgCmd)
|
|
|
|
|
addPkgUpdateCommand(pkgCmd)
|
|
|
|
|
addPkgOutdatedCommand(pkgCmd)
|
|
|
|
|
}
|