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 ci provides release publishing commands.
|
|
|
|
|
package ci
|
2026-01-28 18:33:11 +00:00
|
|
|
|
|
|
|
|
import (
|
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-28 18:33:11 +00:00
|
|
|
)
|
|
|
|
|
|
2026-01-30 00:22:47 +00:00
|
|
|
// Style aliases from shared
|
2026-01-28 18:33:11 +00:00
|
|
|
var (
|
2026-01-30 10:32:05 +00:00
|
|
|
releaseHeaderStyle = cli.RepoNameStyle
|
|
|
|
|
releaseSuccessStyle = cli.SuccessStyle
|
|
|
|
|
releaseErrorStyle = cli.ErrorStyle
|
|
|
|
|
releaseDimStyle = cli.DimStyle
|
|
|
|
|
releaseValueStyle = cli.ValueStyle
|
2026-01-28 18:33:11 +00:00
|
|
|
)
|
|
|
|
|
|
2026-01-30 00:47:54 +00:00
|
|
|
// Flag variables for ci command
|
|
|
|
|
var (
|
|
|
|
|
ciGoForLaunch bool
|
|
|
|
|
ciVersion string
|
|
|
|
|
ciDraft bool
|
|
|
|
|
ciPrerelease bool
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Flag variables for changelog subcommand
|
|
|
|
|
var (
|
|
|
|
|
changelogFromRef string
|
|
|
|
|
changelogToRef string
|
|
|
|
|
)
|
2026-01-28 18:33:11 +00:00
|
|
|
|
2026-01-30 00:47:54 +00:00
|
|
|
var ciCmd = &cobra.Command{
|
|
|
|
|
Use: "ci",
|
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.ci.short"),
|
|
|
|
|
Long: i18n.T("cmd.ci.long"),
|
2026-01-30 00:47:54 +00:00
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
|
|
|
dryRun := !ciGoForLaunch
|
|
|
|
|
return runCIPublish(dryRun, ciVersion, ciDraft, ciPrerelease)
|
|
|
|
|
},
|
|
|
|
|
}
|
2026-01-28 18:33:11 +00:00
|
|
|
|
2026-01-30 00:47:54 +00:00
|
|
|
var ciInitCmd = &cobra.Command{
|
|
|
|
|
Use: "init",
|
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.ci.init.short"),
|
|
|
|
|
Long: i18n.T("cmd.ci.init.long"),
|
2026-01-30 00:47:54 +00:00
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
2026-01-29 12:35:27 +00:00
|
|
|
return runCIReleaseInit()
|
2026-01-30 00:47:54 +00:00
|
|
|
},
|
|
|
|
|
}
|
2026-01-28 18:33:11 +00:00
|
|
|
|
2026-01-30 00:47:54 +00:00
|
|
|
var ciChangelogCmd = &cobra.Command{
|
|
|
|
|
Use: "changelog",
|
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.ci.changelog.short"),
|
|
|
|
|
Long: i18n.T("cmd.ci.changelog.long"),
|
2026-01-30 00:47:54 +00:00
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
|
|
|
return runChangelog(changelogFromRef, changelogToRef)
|
|
|
|
|
},
|
|
|
|
|
}
|
2026-01-28 18:33:11 +00:00
|
|
|
|
2026-01-30 00:47:54 +00:00
|
|
|
var ciVersionCmd = &cobra.Command{
|
|
|
|
|
Use: "version",
|
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.ci.version.short"),
|
|
|
|
|
Long: i18n.T("cmd.ci.version.long"),
|
2026-01-30 00:47:54 +00:00
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
2026-01-29 12:35:27 +00:00
|
|
|
return runCIReleaseVersion()
|
2026-01-30 00:47:54 +00:00
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
// Main ci command flags
|
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
|
|
|
ciCmd.Flags().BoolVar(&ciGoForLaunch, "we-are-go-for-launch", false, i18n.T("cmd.ci.flag.go_for_launch"))
|
|
|
|
|
ciCmd.Flags().StringVar(&ciVersion, "version", "", i18n.T("cmd.ci.flag.version"))
|
|
|
|
|
ciCmd.Flags().BoolVar(&ciDraft, "draft", false, i18n.T("cmd.ci.flag.draft"))
|
|
|
|
|
ciCmd.Flags().BoolVar(&ciPrerelease, "prerelease", false, i18n.T("cmd.ci.flag.prerelease"))
|
2026-01-30 00:47:54 +00:00
|
|
|
|
|
|
|
|
// Changelog subcommand flags
|
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
|
|
|
ciChangelogCmd.Flags().StringVar(&changelogFromRef, "from", "", i18n.T("cmd.ci.changelog.flag.from"))
|
|
|
|
|
ciChangelogCmd.Flags().StringVar(&changelogToRef, "to", "", i18n.T("cmd.ci.changelog.flag.to"))
|
2026-01-30 00:47:54 +00:00
|
|
|
|
|
|
|
|
// Add subcommands
|
|
|
|
|
ciCmd.AddCommand(ciInitCmd)
|
|
|
|
|
ciCmd.AddCommand(ciChangelogCmd)
|
|
|
|
|
ciCmd.AddCommand(ciVersionCmd)
|
2026-01-28 18:33:11 +00:00
|
|
|
}
|