2026-01-29 18:27:33 +00:00
|
|
|
// Package cmd implements the core CLI application.
|
|
|
|
|
//
|
|
|
|
|
// The CLI provides commands for:
|
|
|
|
|
// - Multi-repo development workflows (dev)
|
|
|
|
|
// - AI agent task management (ai)
|
|
|
|
|
// - Go and PHP development tools (go, php)
|
|
|
|
|
// - Build and release automation (build, ci)
|
|
|
|
|
// - SDK validation and API compatibility (sdk)
|
|
|
|
|
// - Package and environment management (pkg, vm)
|
|
|
|
|
// - Documentation and testing (docs, test)
|
|
|
|
|
// - Environment health checks (doctor)
|
|
|
|
|
// - Repository setup and cloning (setup)
|
|
|
|
|
//
|
|
|
|
|
// Two build variants exist:
|
|
|
|
|
// - Default build: Full development toolset
|
|
|
|
|
// - CI build (-tags ci): Minimal release toolset
|
2025-10-27 05:07:22 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/charmbracelet/lipgloss"
|
2025-10-28 12:06:05 +00:00
|
|
|
"github.com/leaanthony/clir"
|
2025-10-27 05:07:22 +00:00
|
|
|
)
|
|
|
|
|
|
2026-01-29 18:27:33 +00:00
|
|
|
// Terminal styles using Tailwind color palette.
|
2025-10-27 05:07:22 +00:00
|
|
|
var (
|
2026-01-29 18:27:33 +00:00
|
|
|
// coreStyle is used for primary headings and the CLI name.
|
2025-10-27 05:07:22 +00:00
|
|
|
coreStyle = lipgloss.NewStyle().
|
2026-01-29 18:27:33 +00:00
|
|
|
Foreground(lipgloss.Color("#3b82f6")). // blue-500
|
2025-10-27 05:07:22 +00:00
|
|
|
Bold(true)
|
|
|
|
|
|
2026-01-29 18:27:33 +00:00
|
|
|
// subPkgStyle is used for subcommand names and secondary headings.
|
2025-10-27 05:07:22 +00:00
|
|
|
subPkgStyle = lipgloss.NewStyle().
|
2026-01-29 18:27:33 +00:00
|
|
|
Foreground(lipgloss.Color("#e2e8f0")). // gray-200
|
2025-10-27 05:07:22 +00:00
|
|
|
Bold(true)
|
|
|
|
|
|
2026-01-29 18:27:33 +00:00
|
|
|
// linkStyle is used for URLs and clickable references.
|
2025-10-27 05:07:22 +00:00
|
|
|
linkStyle = lipgloss.NewStyle().
|
2026-01-29 18:27:33 +00:00
|
|
|
Foreground(lipgloss.Color("#3b82f6")). // blue-500
|
2025-10-27 05:07:22 +00:00
|
|
|
Underline(true)
|
|
|
|
|
)
|
|
|
|
|
|
2026-01-29 18:27:33 +00:00
|
|
|
// Execute initialises and runs the CLI application.
|
|
|
|
|
// Commands are registered based on build tags (see core_ci.go and core_dev.go).
|
2025-10-28 12:06:05 +00:00
|
|
|
func Execute() error {
|
2026-01-29 18:15:22 +00:00
|
|
|
app := clir.NewCli("core", "CLI tool for development and production", "0.1.0")
|
2026-01-29 12:35:27 +00:00
|
|
|
registerCommands(app)
|
2026-01-29 11:28:58 +00:00
|
|
|
return app.Run()
|
2025-10-27 05:07:22 +00:00
|
|
|
}
|