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 php provides Laravel/PHP development commands.
|
|
|
|
|
package php
|
2026-01-28 19:14:06 +00:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/charmbracelet/lipgloss"
|
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 19:14:06 +00:00
|
|
|
)
|
|
|
|
|
|
feat(php): add quality commands and split cmd/php for maintainability
Add new PHP quality commands:
- psalm: Psalm static analysis with auto-fix support
- audit: Security audit for composer and npm dependencies
- security: Filesystem security checks (.env exposure, permissions)
- qa: Full QA pipeline with quick/standard/full stages
- rector: Automated code refactoring with dry-run
- infection: Mutation testing
Split cmd/php/php.go (2k+ lines) into logical files:
- php.go: Styles and command registration
- php_dev.go: dev, logs, stop, status, ssl
- php_build.go: build, serve, shell
- php_quality.go: test, fmt, analyse, psalm, audit, security, qa, rector, infection
- php_packages.go: packages link/unlink/update/list
- php_deploy.go: deploy commands
QA pipeline improvements:
- Suppress tool output noise in pipeline mode
- Show actionable "To fix:" suggestions with commands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:58:03 +00:00
|
|
|
// Style aliases from shared
|
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
|
|
|
var (
|
2026-01-30 10:32:05 +00:00
|
|
|
successStyle = cli.SuccessStyle
|
|
|
|
|
errorStyle = cli.ErrorStyle
|
|
|
|
|
dimStyle = cli.DimStyle
|
|
|
|
|
linkStyle = cli.LinkStyle
|
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
|
|
|
)
|
|
|
|
|
|
2026-01-30 01:04:29 +00:00
|
|
|
// Service colors for log output (domain-specific, keep local)
|
2026-01-28 19:14:06 +00:00
|
|
|
var (
|
2026-01-30 10:32:05 +00:00
|
|
|
phpFrankenPHPStyle = lipgloss.NewStyle().Foreground(cli.ColourIndigo500)
|
|
|
|
|
phpViteStyle = lipgloss.NewStyle().Foreground(cli.ColourYellow500)
|
|
|
|
|
phpHorizonStyle = lipgloss.NewStyle().Foreground(cli.ColourOrange500)
|
|
|
|
|
phpReverbStyle = lipgloss.NewStyle().Foreground(cli.ColourViolet500)
|
|
|
|
|
phpRedisStyle = lipgloss.NewStyle().Foreground(cli.ColourRed500)
|
2026-01-28 19:14:06 +00:00
|
|
|
)
|
|
|
|
|
|
2026-01-30 01:04:29 +00:00
|
|
|
// Status styles (from shared)
|
feat(php): add quality commands and split cmd/php for maintainability
Add new PHP quality commands:
- psalm: Psalm static analysis with auto-fix support
- audit: Security audit for composer and npm dependencies
- security: Filesystem security checks (.env exposure, permissions)
- qa: Full QA pipeline with quick/standard/full stages
- rector: Automated code refactoring with dry-run
- infection: Mutation testing
Split cmd/php/php.go (2k+ lines) into logical files:
- php.go: Styles and command registration
- php_dev.go: dev, logs, stop, status, ssl
- php_build.go: build, serve, shell
- php_quality.go: test, fmt, analyse, psalm, audit, security, qa, rector, infection
- php_packages.go: packages link/unlink/update/list
- php_deploy.go: deploy commands
QA pipeline improvements:
- Suppress tool output noise in pipeline mode
- Show actionable "To fix:" suggestions with commands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:58:03 +00:00
|
|
|
var (
|
2026-01-30 10:32:05 +00:00
|
|
|
phpStatusRunning = cli.SuccessStyle
|
|
|
|
|
phpStatusStopped = cli.StatusPendingStyle
|
|
|
|
|
phpStatusError = cli.ErrorStyle
|
2026-01-30 01:04:29 +00:00
|
|
|
)
|
feat(php): add quality commands and split cmd/php for maintainability
Add new PHP quality commands:
- psalm: Psalm static analysis with auto-fix support
- audit: Security audit for composer and npm dependencies
- security: Filesystem security checks (.env exposure, permissions)
- qa: Full QA pipeline with quick/standard/full stages
- rector: Automated code refactoring with dry-run
- infection: Mutation testing
Split cmd/php/php.go (2k+ lines) into logical files:
- php.go: Styles and command registration
- php_dev.go: dev, logs, stop, status, ssl
- php_build.go: build, serve, shell
- php_quality.go: test, fmt, analyse, psalm, audit, security, qa, rector, infection
- php_packages.go: packages link/unlink/update/list
- php_deploy.go: deploy commands
QA pipeline improvements:
- Suppress tool output noise in pipeline mode
- Show actionable "To fix:" suggestions with commands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:58:03 +00:00
|
|
|
|
2026-01-30 01:04:29 +00:00
|
|
|
// QA command styles (from shared)
|
|
|
|
|
var (
|
2026-01-30 10:32:05 +00:00
|
|
|
phpQAPassedStyle = cli.SuccessStyle
|
|
|
|
|
phpQAFailedStyle = cli.ErrorStyle
|
|
|
|
|
phpQAWarningStyle = cli.WarningStyle
|
|
|
|
|
phpQAStageStyle = cli.StageStyle
|
2026-01-30 01:04:29 +00:00
|
|
|
)
|
feat(php): add quality commands and split cmd/php for maintainability
Add new PHP quality commands:
- psalm: Psalm static analysis with auto-fix support
- audit: Security audit for composer and npm dependencies
- security: Filesystem security checks (.env exposure, permissions)
- qa: Full QA pipeline with quick/standard/full stages
- rector: Automated code refactoring with dry-run
- infection: Mutation testing
Split cmd/php/php.go (2k+ lines) into logical files:
- php.go: Styles and command registration
- php_dev.go: dev, logs, stop, status, ssl
- php_build.go: build, serve, shell
- php_quality.go: test, fmt, analyse, psalm, audit, security, qa, rector, infection
- php_packages.go: packages link/unlink/update/list
- php_deploy.go: deploy commands
QA pipeline improvements:
- Suppress tool output noise in pipeline mode
- Show actionable "To fix:" suggestions with commands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:58:03 +00:00
|
|
|
|
2026-01-30 01:04:29 +00:00
|
|
|
// Security severity styles (from shared)
|
|
|
|
|
var (
|
2026-01-30 10:32:05 +00:00
|
|
|
phpSecurityCriticalStyle = cli.SeverityCriticalStyle
|
|
|
|
|
phpSecurityHighStyle = cli.SeverityHighStyle
|
|
|
|
|
phpSecurityMediumStyle = cli.SeverityMediumStyle
|
|
|
|
|
phpSecurityLowStyle = cli.SeverityLowStyle
|
feat(php): add quality commands and split cmd/php for maintainability
Add new PHP quality commands:
- psalm: Psalm static analysis with auto-fix support
- audit: Security audit for composer and npm dependencies
- security: Filesystem security checks (.env exposure, permissions)
- qa: Full QA pipeline with quick/standard/full stages
- rector: Automated code refactoring with dry-run
- infection: Mutation testing
Split cmd/php/php.go (2k+ lines) into logical files:
- php.go: Styles and command registration
- php_dev.go: dev, logs, stop, status, ssl
- php_build.go: build, serve, shell
- php_quality.go: test, fmt, analyse, psalm, audit, security, qa, rector, infection
- php_packages.go: packages link/unlink/update/list
- php_deploy.go: deploy commands
QA pipeline improvements:
- Suppress tool output noise in pipeline mode
- Show actionable "To fix:" suggestions with commands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:58:03 +00:00
|
|
|
)
|
|
|
|
|
|
2026-01-28 19:14:06 +00:00
|
|
|
// AddPHPCommands adds PHP/Laravel development commands.
|
2026-01-30 00:47:54 +00:00
|
|
|
func AddPHPCommands(root *cobra.Command) {
|
|
|
|
|
phpCmd := &cobra.Command{
|
|
|
|
|
Use: "php",
|
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.php.short"),
|
|
|
|
|
Long: i18n.T("cmd.php.long"),
|
2026-01-30 00:47:54 +00:00
|
|
|
}
|
|
|
|
|
root.AddCommand(phpCmd)
|
2026-01-28 19:14:06 +00:00
|
|
|
|
feat(php): add quality commands and split cmd/php for maintainability
Add new PHP quality commands:
- psalm: Psalm static analysis with auto-fix support
- audit: Security audit for composer and npm dependencies
- security: Filesystem security checks (.env exposure, permissions)
- qa: Full QA pipeline with quick/standard/full stages
- rector: Automated code refactoring with dry-run
- infection: Mutation testing
Split cmd/php/php.go (2k+ lines) into logical files:
- php.go: Styles and command registration
- php_dev.go: dev, logs, stop, status, ssl
- php_build.go: build, serve, shell
- php_quality.go: test, fmt, analyse, psalm, audit, security, qa, rector, infection
- php_packages.go: packages link/unlink/update/list
- php_deploy.go: deploy commands
QA pipeline improvements:
- Suppress tool output noise in pipeline mode
- Show actionable "To fix:" suggestions with commands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:58:03 +00:00
|
|
|
// Development
|
2026-01-28 19:14:06 +00:00
|
|
|
addPHPDevCommand(phpCmd)
|
|
|
|
|
addPHPLogsCommand(phpCmd)
|
|
|
|
|
addPHPStopCommand(phpCmd)
|
|
|
|
|
addPHPStatusCommand(phpCmd)
|
|
|
|
|
addPHPSSLCommand(phpCmd)
|
feat(php): add quality commands and split cmd/php for maintainability
Add new PHP quality commands:
- psalm: Psalm static analysis with auto-fix support
- audit: Security audit for composer and npm dependencies
- security: Filesystem security checks (.env exposure, permissions)
- qa: Full QA pipeline with quick/standard/full stages
- rector: Automated code refactoring with dry-run
- infection: Mutation testing
Split cmd/php/php.go (2k+ lines) into logical files:
- php.go: Styles and command registration
- php_dev.go: dev, logs, stop, status, ssl
- php_build.go: build, serve, shell
- php_quality.go: test, fmt, analyse, psalm, audit, security, qa, rector, infection
- php_packages.go: packages link/unlink/update/list
- php_deploy.go: deploy commands
QA pipeline improvements:
- Suppress tool output noise in pipeline mode
- Show actionable "To fix:" suggestions with commands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:58:03 +00:00
|
|
|
|
|
|
|
|
// Build & Deploy
|
2026-01-28 19:24:11 +00:00
|
|
|
addPHPBuildCommand(phpCmd)
|
|
|
|
|
addPHPServeCommand(phpCmd)
|
|
|
|
|
addPHPShellCommand(phpCmd)
|
feat(php): add quality commands and split cmd/php for maintainability
Add new PHP quality commands:
- psalm: Psalm static analysis with auto-fix support
- audit: Security audit for composer and npm dependencies
- security: Filesystem security checks (.env exposure, permissions)
- qa: Full QA pipeline with quick/standard/full stages
- rector: Automated code refactoring with dry-run
- infection: Mutation testing
Split cmd/php/php.go (2k+ lines) into logical files:
- php.go: Styles and command registration
- php_dev.go: dev, logs, stop, status, ssl
- php_build.go: build, serve, shell
- php_quality.go: test, fmt, analyse, psalm, audit, security, qa, rector, infection
- php_packages.go: packages link/unlink/update/list
- php_deploy.go: deploy commands
QA pipeline improvements:
- Suppress tool output noise in pipeline mode
- Show actionable "To fix:" suggestions with commands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:58:03 +00:00
|
|
|
|
|
|
|
|
// Quality (existing)
|
2026-01-28 19:26:57 +00:00
|
|
|
addPHPTestCommand(phpCmd)
|
|
|
|
|
addPHPFmtCommand(phpCmd)
|
|
|
|
|
addPHPAnalyseCommand(phpCmd)
|
2026-01-28 19:24:11 +00:00
|
|
|
|
feat(php): add quality commands and split cmd/php for maintainability
Add new PHP quality commands:
- psalm: Psalm static analysis with auto-fix support
- audit: Security audit for composer and npm dependencies
- security: Filesystem security checks (.env exposure, permissions)
- qa: Full QA pipeline with quick/standard/full stages
- rector: Automated code refactoring with dry-run
- infection: Mutation testing
Split cmd/php/php.go (2k+ lines) into logical files:
- php.go: Styles and command registration
- php_dev.go: dev, logs, stop, status, ssl
- php_build.go: build, serve, shell
- php_quality.go: test, fmt, analyse, psalm, audit, security, qa, rector, infection
- php_packages.go: packages link/unlink/update/list
- php_deploy.go: deploy commands
QA pipeline improvements:
- Suppress tool output noise in pipeline mode
- Show actionable "To fix:" suggestions with commands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:58:03 +00:00
|
|
|
// Quality (new)
|
|
|
|
|
addPHPPsalmCommand(phpCmd)
|
|
|
|
|
addPHPAuditCommand(phpCmd)
|
|
|
|
|
addPHPSecurityCommand(phpCmd)
|
|
|
|
|
addPHPQACommand(phpCmd)
|
|
|
|
|
addPHPRectorCommand(phpCmd)
|
|
|
|
|
addPHPInfectionCommand(phpCmd)
|
2026-01-28 19:24:11 +00:00
|
|
|
|
feat(php): add quality commands and split cmd/php for maintainability
Add new PHP quality commands:
- psalm: Psalm static analysis with auto-fix support
- audit: Security audit for composer and npm dependencies
- security: Filesystem security checks (.env exposure, permissions)
- qa: Full QA pipeline with quick/standard/full stages
- rector: Automated code refactoring with dry-run
- infection: Mutation testing
Split cmd/php/php.go (2k+ lines) into logical files:
- php.go: Styles and command registration
- php_dev.go: dev, logs, stop, status, ssl
- php_build.go: build, serve, shell
- php_quality.go: test, fmt, analyse, psalm, audit, security, qa, rector, infection
- php_packages.go: packages link/unlink/update/list
- php_deploy.go: deploy commands
QA pipeline improvements:
- Suppress tool output noise in pipeline mode
- Show actionable "To fix:" suggestions with commands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:58:03 +00:00
|
|
|
// Package Management
|
|
|
|
|
addPHPPackagesCommands(phpCmd)
|
2026-01-28 19:39:04 +00:00
|
|
|
|
feat(php): add quality commands and split cmd/php for maintainability
Add new PHP quality commands:
- psalm: Psalm static analysis with auto-fix support
- audit: Security audit for composer and npm dependencies
- security: Filesystem security checks (.env exposure, permissions)
- qa: Full QA pipeline with quick/standard/full stages
- rector: Automated code refactoring with dry-run
- infection: Mutation testing
Split cmd/php/php.go (2k+ lines) into logical files:
- php.go: Styles and command registration
- php_dev.go: dev, logs, stop, status, ssl
- php_build.go: build, serve, shell
- php_quality.go: test, fmt, analyse, psalm, audit, security, qa, rector, infection
- php_packages.go: packages link/unlink/update/list
- php_deploy.go: deploy commands
QA pipeline improvements:
- Suppress tool output noise in pipeline mode
- Show actionable "To fix:" suggestions with commands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 23:58:03 +00:00
|
|
|
// Deployment
|
|
|
|
|
addPHPDeployCommands(phpCmd)
|
2026-01-28 19:39:04 +00:00
|
|
|
}
|