prvng_core/nulib/provisioning setup
Jesús Pérez c62e967ce3
chore: complete KCL to Nickel migration cleanup and setup pre-commit
Clean up 404 KCL references (99.75% complete):
   - Rename kcl_* variables to schema_*/nickel_* (kcl_path→schema_path, etc.)
   - Update functions: parse_kcl_file→parse_nickel_file
   - Update env vars: KCL_MOD_PATH→NICKEL_IMPORT_PATH
   - Fix cli/providers-install: add has_nickel and nickel_version variables
   - Correct import syntax: .nickel.→.ncl.
   - Update 57 files across core, CLI, config, and utilities

   Configure pre-commit hooks:
   - Activate: nushell-check, nickel-typecheck, markdownlint
   - Comment out: Rust hooks (fmt, clippy, test), check-yaml

   Testing:
   - Module discovery: 9 modules (6 providers, 1 taskserv, 2 clusters) 
   - Syntax validation: 15 core files 
   - Pre-commit hooks: all passing 
2026-01-08 20:08:46 +00:00

110 lines
4.2 KiB
Plaintext
Executable File

#!/usr/bin/env nu
# Router for New Setup System
# This file routes setup commands to the main provisioning CLI
# Author: JesusPerezLorenzo
# Release: 1.0.5
# Date: 2025-12-09
# Main entry point - delegate to main provisioning CLI
def main [
...args: string # Command arguments
--debug (-x) # Debug mode
--check (-c) # Dry-run mode
--yes (-y) # Auto-confirm
--verbose (-v) # Verbose output
--interactive # Interactive mode
--notitles # Suppress titles
--out: string = "" # Output format
--helpinfo (-h) # Show help
]: nothing -> nothing {
# Build command-line arguments to pass to main provisioning CLI
let cli_args = [
"setup",
...(if ($args | length) > 0 { $args } else { [] }),
...(if $check { ["--check"] } else { [] }),
...(if $verbose { ["--verbose"] } else { [] }),
...(if $yes { ["--yes"] } else { [] }),
...(if $interactive { ["--interactive"] } else { [] }),
...(if $debug { ["--debug"] } else { [] }),
...(if ($out | is-not-empty) { [$"--out=$out"] } else { [] }),
...(if $helpinfo { ["--help"] } else { [] })
]
# Determine provisioning command location
let provisioning_cmd = (
if ($env.PROVISIONING? | is-not-empty) {
$"($env.PROVISIONING)/core/cli/provisioning"
} else if ($env.PROVISIONING_NAME? | is-not-empty) {
$env.PROVISIONING_NAME
} else {
"provisioning"
}
)
# Delegate to main provisioning CLI
^$provisioning_cmd ...$cli_args
}
# Display help for setup
def show-setup-help [] {
print ""
print "╔═══════════════════════════════════════════════════════════════╗"
print "║ PROVISIONING SETUP SYSTEM ║"
print "║ ║"
print "║ Complete system initialization and configuration management ║"
print "╚═══════════════════════════════════════════════════════════════╝"
print ""
print "USAGE:"
print " provisioning setup <command> [OPTIONS]"
print ""
print "COMMANDS:"
print " system Complete system setup (interactive, defaults, minimal)"
print " workspace Create and configure workspaces"
print " provider Setup infrastructure providers (UpCloud, AWS, Hetzner)"
print " platform Configure platform services (Orchestrator, Control-Center, KMS)"
print " update Update existing configuration"
print " wizard Interactive setup wizard"
print " validate Validate current configuration"
print " detect Detect system capabilities"
print " migrate Migrate existing configurations"
print " status Show setup status"
print " help Show this help message"
print ""
print "COMMON EXAMPLES:"
print " # Interactive setup (recommended)"
print " provisioning setup system --interactive"
print ""
print " # Setup with defaults"
print " provisioning setup system --defaults"
print ""
print " # Check system capabilities"
print " provisioning setup detect --verbose"
print ""
print " # Validate configuration"
print " provisioning setup validate"
print ""
print " # Migrate existing workspace"
print " provisioning setup migrate --auto"
print ""
print "OPTIONS:"
print " --check, -c Dry-run without making changes"
print " --verbose, -v Show detailed output"
print " --yes, -y Auto-confirm prompts"
print " --interactive Use interactive mode"
print ""
print "CONFIGURATION LOCATIONS:"
print " macOS: ~/Library/Application Support/provisioning/"
print " Linux: ~/.config/provisioning/"
print " Windows: %APPDATA%/provisioning/"
print ""
print "For help on specific commands:"
print " provisioning setup <command> --help"
print ""
}