Update core components including CLI, Nushell libraries, plugins system, and utility scripts for the provisioning system. CLI Updates: - Command implementations - CLI utilities and dispatching - Help system improvements - Command validation Library Updates: - Configuration management system - Infrastructure validation - Extension system improvements - Secrets management - Workspace operations - Cache management system Plugin System: - Interactive form plugin (inquire) - KCL integration plugin - Performance optimization plugins - Plugin registration system Utilities: - Build and distribution scripts - Installation procedures - Testing utilities - Development tools Documentation: - Library module documentation - Extension API guides - Plugin usage guides - Service management documentation All changes are backward compatible. No breaking changes.
76 lines
2.2 KiB
Plaintext
76 lines
2.2 KiB
Plaintext
# Diagnostics Command Handlers
|
|
# Handles: status, health, next
|
|
|
|
use ../flags.nu *
|
|
use ../../lib_provisioning/diagnostics *
|
|
|
|
# Main diagnostics command dispatcher
|
|
export def handle_diagnostics_command [
|
|
command: string
|
|
ops: string
|
|
flags: record
|
|
] {
|
|
match $command {
|
|
"status" => { handle_status $ops $flags }
|
|
"health" => { handle_health $ops $flags }
|
|
"next" => { handle_next $flags }
|
|
"phase" => { handle_phase $flags }
|
|
_ => {
|
|
print $"❌ Unknown diagnostics command: ($command)"
|
|
print ""
|
|
print "Available diagnostics commands:"
|
|
print " status - Show comprehensive system status"
|
|
print " health - Run deep health validation"
|
|
print " next - Get next steps recommendations"
|
|
print " phase - Show current deployment phase"
|
|
exit 1
|
|
}
|
|
}
|
|
}
|
|
|
|
# Status command handler
|
|
def handle_status [ops: string, flags: record] {
|
|
let subcommand = ($ops | str trim)
|
|
|
|
if $subcommand == "json" or ($flags.out? | default "" | str trim) == "json" {
|
|
provisioning status-json | to json
|
|
} else {
|
|
provisioning status
|
|
}
|
|
}
|
|
|
|
# Health command handler
|
|
def handle_health [ops: string, flags: record] {
|
|
let subcommand = ($ops | str trim)
|
|
|
|
if $subcommand == "json" or ($flags.out? | default "" | str trim) == "json" {
|
|
provisioning health-json | to json
|
|
} else {
|
|
provisioning health
|
|
}
|
|
}
|
|
|
|
# Next steps command handler
|
|
def handle_next [flags: record] {
|
|
if ($flags.out? | default "" | str trim) == "json" {
|
|
provisioning phase | to json
|
|
} else {
|
|
provisioning next
|
|
}
|
|
}
|
|
|
|
# Phase command handler
|
|
def handle_phase [flags: record] {
|
|
let phase_info = (provisioning phase)
|
|
|
|
if ($flags.out? | default "" | str trim) == "json" {
|
|
$phase_info | to json
|
|
} else {
|
|
print $"(ansi cyan_bold)Current Deployment Phase(ansi reset)\n"
|
|
print $"Phase: (ansi yellow)($phase_info.info.phase)(ansi reset)"
|
|
print $"Description: ($phase_info.info.description)"
|
|
print $"Progress: ($phase_info.info.step)/($phase_info.info.total_steps) steps \(($phase_info.progress_percentage)%\)"
|
|
print $"Ready for deployment: (if $phase_info.info.ready_for_deployment { '✅ Yes' } else { '❌ No' })"
|
|
}
|
|
}
|