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 gocmd provides Go development commands.
|
|
|
|
|
//
|
|
|
|
|
// Note: Package named gocmd because 'go' is a reserved keyword.
|
|
|
|
|
package gocmd
|
2026-01-29 12:22:01 +00:00
|
|
|
|
|
|
|
|
import (
|
2026-01-29 18:13:51 +00:00
|
|
|
"github.com/host-uk/core/cmd/shared"
|
2026-01-30 00:47:54 +00:00
|
|
|
"github.com/spf13/cobra"
|
2026-01-29 12:22:01 +00:00
|
|
|
)
|
|
|
|
|
|
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 aliases for shared styles
|
|
|
|
|
var (
|
|
|
|
|
successStyle = shared.SuccessStyle
|
|
|
|
|
errorStyle = shared.ErrorStyle
|
|
|
|
|
dimStyle = shared.DimStyle
|
|
|
|
|
)
|
|
|
|
|
|
2026-01-29 12:22:01 +00:00
|
|
|
// AddGoCommands adds Go development commands.
|
2026-01-30 00:47:54 +00:00
|
|
|
func AddGoCommands(root *cobra.Command) {
|
|
|
|
|
goCmd := &cobra.Command{
|
|
|
|
|
Use: "go",
|
|
|
|
|
Short: "Go development tools",
|
|
|
|
|
Long: "Go development tools with enhanced output and environment setup.\n\n" +
|
|
|
|
|
"Commands:\n" +
|
|
|
|
|
" test Run tests\n" +
|
|
|
|
|
" cov Run tests with coverage report\n" +
|
|
|
|
|
" fmt Format Go code\n" +
|
|
|
|
|
" lint Run golangci-lint\n" +
|
|
|
|
|
" install Install Go binary\n" +
|
|
|
|
|
" mod Module management (tidy, download, verify)\n" +
|
|
|
|
|
" work Workspace management",
|
|
|
|
|
}
|
2026-01-29 12:22:01 +00:00
|
|
|
|
2026-01-30 00:47:54 +00:00
|
|
|
root.AddCommand(goCmd)
|
2026-01-29 12:22:01 +00:00
|
|
|
addGoTestCommand(goCmd)
|
2026-01-29 13:07:46 +00:00
|
|
|
addGoCovCommand(goCmd)
|
2026-01-29 12:22:01 +00:00
|
|
|
addGoFmtCommand(goCmd)
|
|
|
|
|
addGoLintCommand(goCmd)
|
2026-01-29 13:00:55 +00:00
|
|
|
addGoInstallCommand(goCmd)
|
2026-01-29 12:22:01 +00:00
|
|
|
addGoModCommand(goCmd)
|
|
|
|
|
addGoWorkCommand(goCmd)
|
|
|
|
|
}
|