refactor(setup): move orchestration out of the wizard UI - #759
Open
ffantl-ld wants to merge 4 commits into
Open
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ffantl-ld
force-pushed
the
ffantl/setup-ld/7-wizard-extraction
branch
from
July 27, 2026 20:39
c808955 to
f320691
Compare
ffantl-ld
marked this pull request as ready for review
July 28, 2026 17:37
ari-launchdarkly
left a comment
Contributor
There was a problem hiding this comment.
Why not use the existing projects / environment commands?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the solution you've provided
Moves the setup orchestration out of the UI layer. Adds a
Serviceininternal/setup(with anAuthvalue for credentials, so it never readsviper) that owns every step — list projects/environments, fetch env keys, detect, install, create flag, inject, verify. The Bubble Tea wizard
becomes a thin adapter over the service, and the
detect/install/initsubcommands call the sameservice, removing the wizard-vs-subcommand duplication. The flow is now unit-testable without driving
the TUI.
wizard.go(871 lines) is split intomodel.go/update.go/view.go/commands.go. TheUpdatestate machine (screen sequencing) is unchanged.Related issues
Top of the
setup-ldfeature stack — cleanup on top of the setup command. Stacked PR: base isffantl/setup-ld/6-command.Additional context
resources.Client(drops the unusedflags.Clientarg fromNewSetupCmd; one-line change incmd/root.go).non-interactive
installsubcommand still returns a real error.Requirements
Note
Medium Risk
Refactors the guided setup path and changes flag creation from flags.Client to a direct API POST via resources.Client; wizard behavior is intended unchanged but touches authenticated API and local file install/inject flows.
Overview
Introduces
internal/setup.Servicewith anAuthvalue so setup steps (list projects/environments, env keys, detect, install, create flag, inject, verify) live outside the TUI and never readviper.NewSetupCmdbuilds one service shared by the wizard and the hiddendetect,install, andinitsubcommands, removing duplicated orchestration.The Bubble Tea wizard is refactored from a single
wizard.gointomodel.go,update.go,view.go, andcommands.go; async work is thintea.Cmdwrappers oversetup.Service.flags.Clientis dropped fromNewSetupCmd/cmd/root.go; flag creation goes throughresources.Clienton the service (conflict still treated as success). Install-failure “don’t dead-end” behavior stays in the wizard; theinstallsubcommand still returns errors.Adds
internal/setup/service_test.gofor the new service methods.Reviewed by Cursor Bugbot for commit f320691. Bugbot is set up for automated code reviews on this repo. Configure here.