# Provisioning Platform Installer

Interactive Ratatui-based installer for the Provisioning Platform with Nushell fallback for automation.

> **Source**: `provisioning/platform/installer/`
> **Status**: COMPLETE - All 7 UI screens implemented (1,480 lines)

## Features

- **Rich Interactive TUI**: Beautiful Ratatui interface with real-time feedback
- **Headless Mode**: Automation-friendly with Nushell scripts
- **One-Click Deploy**: Single command to deploy entire platform
- **Platform Agnostic**: Supports Docker, Podman, Kubernetes, OrbStack
- **Live Progress**: Real-time deployment progress and logs
- **Health Checks**: Automatic service health verification

## Installation

```bash
cd provisioning/platform/installer
cargo build --release
cargo install --path .
```plaintext

## Usage

### Interactive TUI (Default)

```bash
provisioning-installer
```plaintext

The TUI guides you through:

1. Platform detection (Docker, Podman, K8s, OrbStack)
2. Deployment mode selection (Solo, Multi-User, CI/CD, Enterprise)
3. Service selection (check/uncheck services)
4. Configuration (domain, ports, secrets)
5. Live deployment with progress tracking
6. Success screen with access URLs

### Headless Mode (Automation)

```bash
# Quick deploy with auto-detection
provisioning-installer --headless --mode solo --yes

# Fully specified
provisioning-installer \
  --headless \
  --platform orbstack \
  --mode solo \
  --services orchestrator,control-center,coredns \
  --domain localhost \
  --yes

# Use existing config file
provisioning-installer --headless --config my-deployment.toml --yes
```plaintext

### Configuration Generation

```bash
# Generate config without deploying
provisioning-installer --config-only

# Deploy later with generated config
provisioning-installer --headless --config ~/.provisioning/installer-config.toml --yes
```plaintext

## Deployment Platforms

### Docker Compose

```bash
provisioning-installer --platform docker --mode solo
```plaintext

**Requirements**: Docker 20.10+, docker-compose 2.0+

### OrbStack (macOS)

```bash
provisioning-installer --platform orbstack --mode solo
```plaintext

**Requirements**: OrbStack installed, 4 GB RAM, 2 CPU cores

### Podman (Rootless)

```bash
provisioning-installer --platform podman --mode solo
```plaintext

**Requirements**: Podman 4.0+, systemd

### Kubernetes

```bash
provisioning-installer --platform kubernetes --mode enterprise
```plaintext

**Requirements**: kubectl configured, Helm 3.0+

## Deployment Modes

### Solo Mode (Development)

- **Services**: 5 core services
- **Resources**: 2 CPU cores, 4 GB RAM, 20 GB disk
- **Use case**: Single developer, local testing

### Multi-User Mode (Team)

- **Services**: 7 services
- **Resources**: 4 CPU cores, 8 GB RAM, 50 GB disk
- **Use case**: Team collaboration, shared infrastructure

### CI/CD Mode (Automation)

- **Services**: 8-10 services
- **Resources**: 8 CPU cores, 16 GB RAM, 100 GB disk
- **Use case**: Automated pipelines, webhooks

### Enterprise Mode (Production)

- **Services**: 15+ services
- **Resources**: 16 CPU cores, 32 GB RAM, 500 GB disk
- **Use case**: Production deployments, full observability

## CLI Options

```plaintext
provisioning-installer [OPTIONS]

OPTIONS:
  --headless              Run in headless mode (no TUI)
  --mode <MODE>           Deployment mode [solo|multi-user|cicd|enterprise]
  --platform <PLATFORM>   Target platform [docker|podman|kubernetes|orbstack]
  --services <SERVICES>   Comma-separated list of services
  --domain <DOMAIN>       Domain/hostname (default: localhost)
  --yes, -y               Skip confirmation prompts
  --config-only           Generate config without deploying
  --config <FILE>         Use existing config file
  -h, --help              Print help
  -V, --version           Print version
```plaintext

## CI/CD Integration

### GitLab CI

```yaml
deploy_platform:
  stage: deploy
  script:
    - provisioning-installer --headless --mode cicd --platform kubernetes --yes
  only:
    - main
```plaintext

### GitHub Actions

```yaml
- name: Deploy Provisioning Platform
  run: |
    provisioning-installer --headless --mode cicd --platform docker --yes
```plaintext

## Nushell Scripts (Fallback)

If the Rust binary is unavailable:

```bash
cd provisioning/platform/installer/scripts
nu deploy.nu --mode solo --platform orbstack --yes
```plaintext

## Related Documentation

- **Deployment Guide**: [Platform Deployment](../guides/from-scratch.md)
- **Architecture**: [Platform Overview](../architecture/ARCHITECTURE_OVERVIEW.md)
