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 00:22:47 +00:00
|
|
|
"github.com/host-uk/core/cmd/shared"
|
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 00:22:47 +00:00
|
|
|
successStyle = shared.SuccessStyle
|
|
|
|
|
errorStyle = shared.ErrorStyle
|
|
|
|
|
warningStyle = shared.WarningStyle
|
|
|
|
|
dimStyle = shared.DimStyle
|
|
|
|
|
valueStyle = shared.ValueStyle
|
|
|
|
|
headerStyle = shared.HeaderStyle
|
|
|
|
|
repoNameStyle = shared.RepoNameStyle
|
|
|
|
|
)
|
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 01:09:03 +00:00
|
|
|
dirtyStyle = shared.GitDirtyStyle.Padding(0, 1)
|
|
|
|
|
aheadStyle = shared.GitAheadStyle.Padding(0, 1)
|
|
|
|
|
cleanStyle = shared.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",
|
|
|
|
|
Short: "Multi-repo development workflow",
|
|
|
|
|
Long: `Manage multiple git repositories and GitHub integration.
|
|
|
|
|
|
|
|
|
|
Uses repos.yaml to discover repositories. Falls back to scanning
|
|
|
|
|
the current directory if no registry is found.
|
|
|
|
|
|
|
|
|
|
Git Operations:
|
|
|
|
|
work Combined status -> commit -> push workflow
|
|
|
|
|
health Quick repo health summary
|
|
|
|
|
commit Claude-assisted commit messages
|
|
|
|
|
push Push repos with unpushed commits
|
|
|
|
|
pull Pull repos behind remote
|
|
|
|
|
|
|
|
|
|
GitHub Integration (requires gh CLI):
|
|
|
|
|
issues List open issues across repos
|
|
|
|
|
reviews List PRs awaiting review
|
|
|
|
|
ci Check GitHub Actions status
|
|
|
|
|
impact Analyse dependency impact
|
|
|
|
|
|
|
|
|
|
Dev Environment:
|
|
|
|
|
install Download dev environment image
|
|
|
|
|
boot Start dev environment VM
|
|
|
|
|
stop Stop dev environment VM
|
|
|
|
|
shell Open shell in dev VM
|
|
|
|
|
status Check dev VM status`,
|
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|