TypeDialog

Typed dialogs for inputs, forms and schemas you can trust

3,818 Tests | 6 Backends | 4 LLM Providers

Create Type-Safe Interactive Dialogs

Declarative forms with Nickel/TOML definitions, 6 backends (CLI, TUI, Web, AI, Agent, Prov-Gen), and type-safe validation. From interactive prompts to infrastructure generation. One schema. Every surface.

What TypeDialog Solves

Per-Backend Code

One Nickel or TOML definition drives CLI, TUI, Web, and AI. No per-backend form code. The schema is the single source of truth.

Fail-Open Validation

Nickel contracts validate every predicate at load time. Unknown predicates cause hard failures, not silent passes. No parallel Rust reimplementation.

Hidden I/O in Execution

Fragment loading happens once at load_form(). The three-phase executor is pure — no filesystem access, no side effects during user interaction.

Manual IaC Assembly

Interactive forms generate validated infrastructure configurations for 6 cloud providers. 7-layer validation pipeline from forms to final JSON.

How It Works

📄

Declarative Forms

Define forms in Nickel (.ncl) or TOML (.toml). Nickel provides contracts, imports, and type-safe composition. TOML provides zero-dependency simplicity. Both produce identical FormDefinition structs.

⚙️

Three-Phase Execution

Phase 1: Execute selector fields that control conditionals. Phase 2: Build element list (pure, no I/O). Phase 3: Dispatch to backend with when/when_false evaluation. Complete or field-by-field rendering modes.

🏭

BackendFactory

Compile-time feature gates eliminate dead backend code. Runtime BackendType match dispatches to the selected backend. Auto-detection via TYPEDIALOG_BACKEND env var with CLI fallback.

🤖

AI & Agent Backends

AI backend with RAG, embeddings, and semantic search. Agent backend executes .agent.mdx files with multi-LLM support (Claude, OpenAI, Gemini, Ollama). Template variables, file imports, streaming output.

☁️

Infrastructure Generation

Prov-Gen transforms form answers into IaC configurations. 6 cloud providers (AWS, GCP, Azure, Hetzner, UpCloud, LXD). 7-layer validation pipeline from forms to final JSON.

🔄

Nickel Roundtrip

Read .ncl schemas, collect user input via any backend, generate validated .ncl output preserving contracts. ContractParser extracts validators. TemplateRenderer preserves formatting.

Architecture

TypeDialog architecture diagram

Backends

CLI
inquire — interactive prompts
TUI
ratatui — terminal UI
Web
axum — HTTP forms
AI
RAG & embeddings
Agent
Multi-LLM execution
Prov-Gen
IaC generation

Technology Stack

Rust (8 crates)Nickel ContractsTOML FormsInquire (CLI)Ratatui (TUI)Axum (Web)Fluent i18nTera TemplatesNushell PluginClaude APIOpenAI APIGemini APIOllama (local)Multi-Cloud IaC

Type-safe dialogs for every surface

Built with Rust | Open Source | MIT License