2026-01-30 00:22:47 +00:00
|
|
|
// Package dev provides multi-repo development workflow commands.
|
|
|
|
|
//
|
|
|
|
|
// Git Operations:
|
|
|
|
|
// - work: Combined status, commit, and push workflow
|
|
|
|
|
// - health: Quick health check across all repos
|
|
|
|
|
// - commit: Claude-assisted commit message generation
|
|
|
|
|
// - push: Push repos with unpushed commits
|
|
|
|
|
// - pull: Pull repos that are behind remote
|
|
|
|
|
//
|
|
|
|
|
// GitHub Integration (requires gh CLI):
|
|
|
|
|
// - issues: List open issues across repos
|
|
|
|
|
// - reviews: List PRs needing review
|
|
|
|
|
// - ci: Check GitHub Actions CI status
|
|
|
|
|
// - impact: Analyse dependency impact of changes
|
|
|
|
|
//
|
|
|
|
|
// API Tools:
|
|
|
|
|
// - api sync: Synchronize public service APIs
|
|
|
|
|
//
|
|
|
|
|
// Dev Environment (VM management):
|
|
|
|
|
// - install: Download dev environment image
|
|
|
|
|
// - boot: Start dev environment VM
|
|
|
|
|
// - stop: Stop dev environment VM
|
|
|
|
|
// - status: Check dev VM status
|
|
|
|
|
// - shell: Open shell in dev VM
|
|
|
|
|
// - serve: Mount project and start dev server
|
|
|
|
|
// - test: Run tests in dev environment
|
|
|
|
|
// - claude: Start sandboxed Claude session
|
|
|
|
|
// - update: Check for and apply updates
|
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 dev
|
2026-01-29 02:23:29 +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-29 02:23:29 +00:00
|
|
|
)
|
|
|
|
|
|
2026-01-30 00:22:47 +00:00
|
|
|
// Style aliases from shared package
|
2026-01-29 02:23:29 +00:00
|
|
|
var (
|
2026-01-30 10:32:05 +00:00
|
|
|
successStyle = cli.SuccessStyle
|
|
|
|
|
errorStyle = cli.ErrorStyle
|
|
|
|
|
warningStyle = cli.WarningStyle
|
|
|
|
|
dimStyle = cli.DimStyle
|
|
|
|
|
valueStyle = cli.ValueStyle
|
|
|
|
|
headerStyle = cli.HeaderStyle
|
|
|
|
|
repoNameStyle = cli.RepoNameStyle
|
2026-01-30 00:22:47 +00:00
|
|
|
)
|
2026-01-29 02:23:29 +00:00
|
|
|
|
2026-01-30 01:35:13 +00:00
|
|
|
// Table styles for status display (extends shared styles with cell padding)
|
2026-01-30 00:22:47 +00:00
|
|
|
var (
|
2026-01-30 10:32:05 +00:00
|
|
|
dirtyStyle = cli.GitDirtyStyle.Padding(0, 1)
|
|
|
|
|
aheadStyle = cli.GitAheadStyle.Padding(0, 1)
|
|
|
|
|
cleanStyle = cli.GitCleanStyle.Padding(0, 1)
|
2026-01-29 02:23:29 +00:00
|
|
|
)
|
|
|
|
|
|
2026-01-30 00:22:47 +00:00
|
|
|
// AddCommands registers the 'dev' command and all subcommands.
|
2026-01-30 00:47:54 +00:00
|
|
|
func AddCommands(root *cobra.Command) {
|
|
|
|
|
devCmd := &cobra.Command{
|
|
|
|
|
Use: "dev",
|
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.dev.short"),
|
|
|
|
|
Long: i18n.T("cmd.dev.long"),
|
2026-01-30 00:47:54 +00:00
|
|
|
}
|
|
|
|
|
root.AddCommand(devCmd)
|
2026-01-30 00:22:47 +00:00
|
|
|
|
|
|
|
|
// Git operations
|
|
|
|
|
addWorkCommand(devCmd)
|
|
|
|
|
addHealthCommand(devCmd)
|
|
|
|
|
addCommitCommand(devCmd)
|
|
|
|
|
addPushCommand(devCmd)
|
|
|
|
|
addPullCommand(devCmd)
|
|
|
|
|
|
|
|
|
|
// GitHub integration
|
|
|
|
|
addIssuesCommand(devCmd)
|
|
|
|
|
addReviewsCommand(devCmd)
|
|
|
|
|
addCICommand(devCmd)
|
|
|
|
|
addImpactCommand(devCmd)
|
|
|
|
|
|
|
|
|
|
// API tools
|
|
|
|
|
addAPICommands(devCmd)
|
|
|
|
|
|
|
|
|
|
// Dev environment
|
|
|
|
|
addVMCommands(devCmd)
|
2026-01-29 02:23:29 +00:00
|
|
|
}
|