# TypeDialog + Nickel Configuration Scripts

Phase 8 Nushell automation scripts for interactive configuration workflow, config generation, validation, and deployment.

## Quick Start

```toml
# 1. Interactive Configuration (TypeDialog)
nu scripts/configure.nu orchestrator solo

# 2. Generate TOML configs
nu scripts/generate-configs.nu orchestrator solo

# 3. Validate configuration
nu scripts/validate-config.nu provisioning/.typedialog/provisioning/platform/values/orchestrator.solo.ncl

# 4. Render Docker Compose
nu scripts/render-docker-compose.nu solo

# 5. Full deployment workflow
nu scripts/install-services.nu orchestrator solo --docker
```

## Scripts Overview

### Shared Helpers
- **ansi.nu** - ANSI color and emoji output formatting
- **paths.nu** - Path validation and directory structure helpers  
- **external.nu** - Safe external command execution with error handling

### Core Configuration Scripts
- **configure.nu** - Interactive TypeDialog configuration wizard
- **generate-configs.nu** - Export Nickel configs to TOML
- **validate-config.nu** - Validate Nickel configuration

### Rendering Scripts
- **render-docker-compose.nu** - Render Docker Compose from Nickel templates
- **render-kubernetes.nu** - Render Kubernetes manifests from Nickel templates

### Deployment & Monitoring Scripts
- **install-services.nu** - Full deployment orchestration
- **detect-services.nu** - Auto-detect running services

## Supported Services
- orchestrator (port 9090)
- control-center (port 8080)
- mcp-server (port 8888)
- installer (port 8000)

## Supported Deployment Modes
- solo (2 CPU, 4GB RAM)
- multiuser (4 CPU, 8GB RAM)
- cicd (8 CPU, 16GB RAM)
- enterprise (16+ CPU, 32+ GB RAM)

## Nushell Compliance
All scripts follow Nushell 0.109.0+ guidelines with proper type signatures, error handling, and no try-catch blocks.

## Examples

### Single Service Configuration
```toml
nu scripts/configure.nu orchestrator solo --backend web
nu scripts/validate-config.nu provisioning/.typedialog/provisioning/platform/values/orchestrator.solo.ncl
nu scripts/generate-configs.nu orchestrator solo
cargo run -p orchestrator -- --config provisioning/platform/config/orchestrator.solo.toml
```

### Docker Compose Deployment
```toml
nu scripts/generate-configs.nu orchestrator multiuser
nu scripts/render-docker-compose.nu multiuser
docker-compose -f provisioning/platform/infrastructure/docker/docker-compose.multiuser.yml up -d
```

### Kubernetes Deployment
```yaml
nu scripts/generate-configs.nu orchestrator enterprise
nu scripts/render-kubernetes.nu enterprise --namespace production
nu scripts/install-services.nu all enterprise --kubernetes --namespace production
```

## Phase 8 Status

✅ Phase 8.A: Shared helper modules
✅ Phase 8.B: Core configuration scripts  
✅ Phase 8.C: Rendering scripts
✅ Phase 8.D: Deployment orchestration
✅ Phase 8.E: Testing and documentation

## Requirements

- Nushell 0.109.1+
- Nickel 1.15.1+
- TypeDialog CLI
- yq v4.50.1+
- Docker (optional)
- kubectl (optional)
