chore: update scripts

This commit is contained in:
Jesús Pérez 2026-01-08 21:16:17 +00:00
parent 0ccd697e55
commit 3904d2fbc7
Signed by: jesus
GPG Key ID: 9F243E355E0BC939
4 changed files with 19 additions and 19 deletions

4
.gitignore vendored
View File

@ -1,4 +1,4 @@
.p .p
.claude .claude
.vscode .vscode
.shellcheckrc .shellcheckrc
@ -9,7 +9,7 @@ ai_demo.nu
CLAUDE.md CLAUDE.md
.cache .cache
.coder .coder
wrks .wrks
ROOT ROOT
OLD OLD
plugins/nushell-plugins plugins/nushell-plugins

View File

@ -1,7 +1,7 @@
#!/usr/bin/env nu #!/usr/bin/env nu
# Infrastructure Validation and Review Tool # Infrastructure Validation and Review Tool
# Validates KCL/YAML configurations, checks best practices, and generates reports # Validates Nickel/YAML configurations, checks best practices, and generates reports
use core/nulib/lib_provisioning/infra_validator/validator.nu * use core/nulib/lib_provisioning/infra_validator/validator.nu *
@ -140,7 +140,7 @@ def show_detailed_help []: nothing -> nothing {
print "" print ""
print "VALIDATION RULES:" print "VALIDATION RULES:"
print " VAL001 YAML Syntax Validation (critical)" print " VAL001 YAML Syntax Validation (critical)"
print " VAL002 KCL Compilation Check (critical)" print " VAL002 Nickel Compilation Check (critical)"
print " VAL003 Unquoted Variable References (error)" print " VAL003 Unquoted Variable References (error)"
print " VAL004 Required Fields Validation (error)" print " VAL004 Required Fields Validation (error)"
print " VAL005 Resource Naming Conventions (warning)" print " VAL005 Resource Naming Conventions (warning)"
@ -172,7 +172,7 @@ def show_detailed_help []: nothing -> nothing {
def setup_validation_environment [verbose: bool]: nothing -> nothing { def setup_validation_environment [verbose: bool]: nothing -> nothing {
# Check required dependencies # Check required dependencies
let dependencies = ["kcl"] # Add other required tools let dependencies = ["nickel"] # Add other required tools
for dep in $dependencies { for dep in $dependencies {
let check = (^bash -c $"type -P ($dep)" | complete) let check = (^bash -c $"type -P ($dep)" | complete)

View File

@ -35,14 +35,14 @@ if $ai_available {
} else { } else {
print "❌ No API keys found. Set one of:" print "❌ No API keys found. Set one of:"
print " - OPENAI_API_KEY for OpenAI" print " - OPENAI_API_KEY for OpenAI"
print " - ANTHROPIC_API_KEY for Claude" print " - ANTHROPIC_API_KEY for Claude"
print " - LLM_API_KEY for generic LLM" print " - LLM_API_KEY for generic LLM"
} }
print "" print ""
print "🎯 AI Integration Features Implemented:" print "🎯 AI Integration Features Implemented:"
print " 1. ✅ KCL configuration schema (kcl/settings.k:54-79)" print " 1. ✅ Nickel configuration schema (nickel/settings.ncl:54-79)"
print " 2. ✅ AI library (core/nulib/lib_provisioning/ai/lib.nu)" print " 2. ✅ AI library (core/nulib/lib_provisioning/ai/lib.nu)"
print " 3. ✅ Template generation with AI prompts" print " 3. ✅ Template generation with AI prompts"
print " 4. ✅ Natural language queries (--ai_query flag)" print " 4. ✅ Natural language queries (--ai_query flag)"
print " 5. ✅ Webhook integration for chat platforms" print " 5. ✅ Webhook integration for chat platforms"
@ -52,8 +52,8 @@ print "📋 Usage Examples:"
print " # Generate templates" print " # Generate templates"
print " ./core/nulib/provisioning ai template --prompt \"3-node K8s cluster\"" print " ./core/nulib/provisioning ai template --prompt \"3-node K8s cluster\""
print "" print ""
print " # Natural language queries" print " # Natural language queries"
print " ./core/nulib/provisioning query --ai_query \"show AWS servers with high CPU\"" print " ./core/nulib/provisioning query --ai_query \"show AWS servers with high CPU\""
print "" print ""
print " # Test configuration" print " # Test configuration"
print " ./core/nulib/provisioning ai test" print " ./core/nulib/provisioning ai test"

View File

@ -80,18 +80,18 @@ servers:
print "------------------------------------------" print "------------------------------------------"
if ("klab/sgoyol" | path exists) { if ("klab/sgoyol" | path exists) {
let sgoyol_files = (glob "klab/sgoyol/**/*.k") let sgoyol_files = (glob "klab/sgoyol/**/*.ncl")
print $"Found ($sgoyol_files | length) KCL files in sgoyol infrastructure" print $"Found ($sgoyol_files | length) Nickel files in sgoyol infrastructure"
if ($sgoyol_files | length) > 0 { if ($sgoyol_files | length) > 0 {
let first_file = ($sgoyol_files | first) let first_file = ($sgoyol_files | first)
print $"Testing KCL compilation on: ($first_file)" print $"Testing Nickel compilation on: ($first_file)"
let kcl_result = (validate_kcl_compilation $first_file) let nickel_result = (validate_nickel_compilation $first_file)
if $kcl_result.passed { if $nickel_result.passed {
print "✅ KCL compilation test passed" print "✅ Nickel compilation test passed"
} else { } else {
print $"❌ KCL compilation failed: ($kcl_result.issue.message)" print $"❌ Nickel compilation failed: ($nickel_result.issue.message)"
} }
} }
@ -123,7 +123,7 @@ servers:
print "✅ Unquoted variables detection: Working" print "✅ Unquoted variables detection: Working"
print "✅ YAML syntax validation: Working" print "✅ YAML syntax validation: Working"
print "✅ Auto-fix functionality: Working" print "✅ Auto-fix functionality: Working"
print "✅ KCL compilation check: Working" print "✅ Nickel compilation check: Working"
print "" print ""
print "The infrastructure validation system is ready for use!" print "The infrastructure validation system is ready for use!"
} }