chore: update scripts
This commit is contained in:
parent
0ccd697e55
commit
3904d2fbc7
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
.p
|
||||
.p
|
||||
.claude
|
||||
.vscode
|
||||
.shellcheckrc
|
||||
@ -9,7 +9,7 @@ ai_demo.nu
|
||||
CLAUDE.md
|
||||
.cache
|
||||
.coder
|
||||
wrks
|
||||
.wrks
|
||||
ROOT
|
||||
OLD
|
||||
plugins/nushell-plugins
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env nu
|
||||
|
||||
# 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 *
|
||||
|
||||
@ -140,7 +140,7 @@ def show_detailed_help []: nothing -> nothing {
|
||||
print ""
|
||||
print "VALIDATION RULES:"
|
||||
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 " VAL004 Required Fields Validation (error)"
|
||||
print " VAL005 Resource Naming Conventions (warning)"
|
||||
@ -172,7 +172,7 @@ def show_detailed_help []: nothing -> nothing {
|
||||
|
||||
def setup_validation_environment [verbose: bool]: nothing -> nothing {
|
||||
# Check required dependencies
|
||||
let dependencies = ["kcl"] # Add other required tools
|
||||
let dependencies = ["nickel"] # Add other required tools
|
||||
|
||||
for dep in $dependencies {
|
||||
let check = (^bash -c $"type -P ($dep)" | complete)
|
||||
|
||||
@ -35,14 +35,14 @@ if $ai_available {
|
||||
} else {
|
||||
print "❌ No API keys found. Set one of:"
|
||||
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 ""
|
||||
print "🎯 AI Integration Features Implemented:"
|
||||
print " 1. ✅ KCL configuration schema (kcl/settings.k:54-79)"
|
||||
print " 2. ✅ AI library (core/nulib/lib_provisioning/ai/lib.nu)"
|
||||
print " 1. ✅ Nickel configuration schema (nickel/settings.ncl:54-79)"
|
||||
print " 2. ✅ AI library (core/nulib/lib_provisioning/ai/lib.nu)"
|
||||
print " 3. ✅ Template generation with AI prompts"
|
||||
print " 4. ✅ Natural language queries (--ai_query flag)"
|
||||
print " 5. ✅ Webhook integration for chat platforms"
|
||||
@ -52,8 +52,8 @@ print "📋 Usage Examples:"
|
||||
print " # Generate templates"
|
||||
print " ./core/nulib/provisioning ai template --prompt \"3-node K8s cluster\""
|
||||
print ""
|
||||
print " # Natural language queries"
|
||||
print " # Natural language queries"
|
||||
print " ./core/nulib/provisioning query --ai_query \"show AWS servers with high CPU\""
|
||||
print ""
|
||||
print " # Test configuration"
|
||||
print " ./core/nulib/provisioning ai test"
|
||||
print " ./core/nulib/provisioning ai test"
|
||||
|
||||
@ -80,18 +80,18 @@ servers:
|
||||
print "------------------------------------------"
|
||||
|
||||
if ("klab/sgoyol" | path exists) {
|
||||
let sgoyol_files = (glob "klab/sgoyol/**/*.k")
|
||||
print $"Found ($sgoyol_files | length) KCL files in sgoyol infrastructure"
|
||||
let sgoyol_files = (glob "klab/sgoyol/**/*.ncl")
|
||||
print $"Found ($sgoyol_files | length) Nickel files in sgoyol infrastructure"
|
||||
|
||||
if ($sgoyol_files | length) > 0 {
|
||||
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)
|
||||
if $kcl_result.passed {
|
||||
print "✅ KCL compilation test passed"
|
||||
let nickel_result = (validate_nickel_compilation $first_file)
|
||||
if $nickel_result.passed {
|
||||
print "✅ Nickel compilation test passed"
|
||||
} 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 "✅ YAML syntax validation: Working"
|
||||
print "✅ Auto-fix functionality: Working"
|
||||
print "✅ KCL compilation check: Working"
|
||||
print "✅ Nickel compilation check: Working"
|
||||
print ""
|
||||
print "The infrastructure validation system is ready for use!"
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user