Repository navigation
feat(init): redesign the adl init wizard with a branded huh/lipgloss TUI - #188
Conversation
Replace the plain readline prompts with an interactive huh v2 + lipgloss v2 wizard (new internal/tui package): violet brand theme, an "Agent Definition Language" banner, grouped form pages, multi-selects, and a boxed summary. The --defaults / non-interactive flow is also restyled but its generated agent.yaml stays byte-for-byte identical (verified across 13 flag combos) — the only intentional manifest change is the default language go -> typescript. cmd/init.go is refactored around a pure buildADL(answers) core fed by both the non-interactive collector and the wizard. The wizard now offers all 5 AI orchestrators (claudecode, codex, gemini, opencode, infer) and all 11 gateway providers. Output is routed through lipgloss's color-profile writer so ANSI is stripped in non-TTY (CI/pipes); the huh wizard only launches when both stdin and stdout are a TTY and --defaults is unset.
9b0d17b to
f0e0a0b
Compare
## [0.42.0](v0.41.4...v0.42.0) (2026-06-03) ### ✨ Features * **init:** redesign the adl init wizard with a branded huh/lipgloss TUI ([#188](#188)) ([5fdc32c](5fdc32c))
|
@claude Can you create the follow ups? use /maintainer (file max 5 issues). |
|
Claude finished @edenreich's task in 6m 57s —— View job Follow-up issues created (5)All five follow-ups from the PR description are filed. Each was verified against the code first, and templates/labels were taken from the org defaults in
Dependency chain: #189 is marked blocked by Limitations (need a maintainer with broader scope)
Not filed (respecting the max-5 limit)
|
|
🎉 This PR is included in version 0.42.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
internal/tuipackage (theme.go,banner.go,summary.go,console.go,run.go) wrapping charmbracelethuhv2 +lipglossv2. Violet/purple brand theme, a banner titled "Agent Definition Language", a boxed run summary, section headers, andlabel › valuerows. Output is routed through lipgloss's color-profile writer so ANSI is stripped in non-TTY (CI/pipes).cmd/init.gorefactored around a purebuildADL(answers)core.runInitdispatches to the interactive huh wizard (runInitInteractiveincmd/init_wizard.go) only when both stdin and stdout are a TTY and--defaultsis unset; otherwise it takes the plain non-interactive flow (runInitNonInteractive). Both the non-interactive collector and the wizard feed the samebuildADL.--defaultsconsole output restyled to useechoRow/tui.Bulletlines instead of literal prompt echoes (stdout-only; the generatedagent.yamlis unchanged).go → typescript(init default value + wizard select order).openai, anthropic, google, groq, mistral, deepseek, cohere, cloudflare, moonshot, ollama, ollama_cloud) via a sharedaiProviderslist used by the wizard select, the non-interactive choice, and--providerhelp.claudecode, codex, gemini, opencode, infer) via a wizard multi-select; the answers struct gained per-orchestrator bools andbuildADLwires them.claudecodeis still driven by--aion the non-interactive path; the other four are wizard/manifest-only..Height(n+2)(multiSelectHeight) because static.Options()otherwise collapses the viewport to one row; confirms use aleftConfirm()helper (WithButtonAlignment(lipgloss.Left)) since huh defaults to centered buttons.cmd/buildadl_test.goforbuildADL.Behavior preserved
--defaultspath and the generatedagent.yamlare byte-for-byte unchanged, with one documented exception: the default-language switchgo → typescript. A diff of the old (HEAD) vs new binary across 13 flag combinations (default, each language,--ai,--ci --cd,--type minimal,--flox,--devcontainer,--docker-compose,--deployment kubernetes,--provider,--model) shows the only manifest delta in any combo is the 8-linelanguage:hunk, and only when--languageis omitted. With--languageset explicitly, output is identical to HEAD.tui.IsTTY()requires both stdin and stdout to be terminals, so CI/piped/go testinvocations always fall through torunInitNonInteractiveeven without--defaults. The huh wizard cannot launch in a non-TTY.false; only--aiflipsclaudecodeon the non-interactive path.adlData,vendorBlock,aiBlock,orchestratorsBlock), so YAML key ordering is unaffected; all extension points (services: [logger], vendordeps:[]/devdeps:[],development.deps:[],orchestrators) still render.cmd/init_test.gotests (all--defaults-driven) plus the 4 newcmd/buildadl_test.gogolden tests pass.New dependencies
charm.land/huh/v2v2.0.3charm.land/lipgloss/v2v2.0.3charm.land/bubbletea/v2v2.0.2,charm.land/bubbles/v2v2.0.0golang.org/x/termv0.43.0Cross-repo follow-up
The ADL schema's
spec.agent.providerenum lags the gateway. The vendoredinternal/schema/schema.json(pinned atADL_SCHEMA_VERSION: v0.12.0) lists only 7 providers -["", openai, anthropic, ollama, deepseek, google, mistral, groq]- and is missing 4 of the 11 the wizard now offers:ollama_cloud,cloudflare,cohere,moonshot. Selecting any of those will failadl validateuntil:inference-gateway/adl, then re-vendored here (bumpADL_SCHEMA_VERSION,task fetch-schema,task generate-types).inference-gateway/docs.This PR does NOT include those changes - it only adds the providers to the CLI's selection list (the inline comment at
cmd/init.goalready documents the gap).Known pre-existing issues (not addressed here)
spec.servicesrendered as an array vs the schema's expected object - so the defaultadl init --defaultsmanifest failsadl validate. Pre-existing, unchanged by this refactor.--provider/--modelignored in--defaultsmode - those paths useconditionalPromptChoice/conditionalPrompt, not viper, so the flags are not written.Verification
go build ./...→ PASS (clean)go test ./... -count=1→ PASS - all packages green (cmdincl.buildadl_test.go+init_test.go,internal/generatorincl. thegpt-5.5fixture edits, and the rest).internal/tuicompiles/lints clean but has no test files of its own.golangci-lint run ./...→ PASS -0 issues.gofmt -l cmd/ internal/tui/→ PASS (no output)go vet ./...→ PASSAlso includes user-made fixture edits in
internal/generator/typescript_test.goandinternal/templates/common/docs/README.md.tmpl(example model namesgpt-4o/gpt-4o-mini→gpt-5.5).