feat: add guided setup command - #753
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
56fef68 to
3680877
Compare
Address two review findings on the setup wizard: - runInstall discarded the underlying install error, so the manual-install screen showed only the command with no indication of why the automatic install failed. Carry the error onto InstallResult.FailureReason and render it on the failure screen. - The "toggle your flag" link hardcoded https://app.launchdarkly.com, which is wrong on federal/custom instances. Derive the host from the configured --base-uri. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 97c6a7d. Configure here.
| quickStartCmd.Use = "quickstart" | ||
| quickStartCmd.Hidden = true | ||
| quickStartCmd.Deprecated = "use 'ldcli setup' for the new guided setup experience" | ||
| cmd.AddCommand(quickStartCmd) |
There was a problem hiding this comment.
Symbols command registration removed
High Severity
The symbols command import and AddCommand wiring were dropped from the root command, and its help entry was removed from the usage template, while cmd/symbols still exists and was recently shipped. Users can no longer run ldcli symbols.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 97c6a7d. Configure here.
| } | ||
| // Compute the plan preview shown before any action is taken. | ||
| args, _ := setup.InstallArgs(chosen.id, "") | ||
| m.planInstallCmd = strings.Join(args, " ") |
There was a problem hiding this comment.
Detected package manager discarded
High Severity
Detection finds PackageManager (yarn/pnpm/bun/npm), but the wizard only caches SDK id and entry point, then builds detectResult without it and previews install with an empty package manager. Node installs fall back to npm even in yarn/pnpm/bun projects.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 97c6a7d. Configure here.
| SDKID: chosen.id, | ||
| Language: chosen.language, | ||
| EntryPoint: m.detectedEntryPoint, | ||
| } |
There was a problem hiding this comment.
Wrong entry point after SDK override
Medium Severity
When the user picks a different SDK than the one detected, detectResult still reuses detectedEntryPoint. For append-safe SDKs, runInit then injects that SDK’s code into the original language’s file, which can corrupt the wrong source file.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 97c6a7d. Configure here.
|
Review resolution map — the 8 inline findings from the original review on the superseded #744 were migrated and resolved as follows (that PR was closed when this work was split into the #748–753 stack, so the threads were stranded there):
via LD Research 🤖 |


Describe the solution you've provided
Final layer: the user-facing
setupcommand. Adds thecmd/setuppackage (detect,install,initsubcommands and the interactive wizard) over theinternal/setuplibrary, wires it into the root command, and deprecatesquickstartin favor ofsetup.The
ldcli setupwizard walks a user through detecting their project, installing the SDK, creating a first flag, injecting init code, and verifying an evaluation.Related issues
Top of the
setup-ldfeature stack. Stacked PR — base isffantl/setup-ld/4-verifier.Note: this branch's
cmd/root.goalso carries thePersistentPreRunchange from #748; that diff drops out once #748 merges to main and this stack is rebased.Requirements
Note
Medium Risk
The wizard runs package managers and writes into the user's project while calling LaunchDarkly APIs to create flags and read SDK keys; failures are mostly surfaced with manual fallbacks, but mistaken project/env or file injection still has real user impact.
Overview
Adds
ldcli setupas the primary onboarding path: an interactive wizard (Bubble Tea) that picks project/environment, auto-detects the repo, lets you confirm or override the SDK, shows a plan preview, then installs the package, creates a starter flag (my-new-flag), injects init code, and optionally verifies SDK activity.Also adds hidden subcommands for scripting/automation:
setup detect,setup install(with--dry-run), andsetup init, all supporting plaintext/JSON output via existing--outputbehavior.Root CLI changes: wires
setupwith injectableDetector/Installer(defaults toFileDetector/PackageInstaller), listssetupin the usage template, and keepsquickstartas a hidden, deprecated alias. Replaces the oldDisableFlagParsinghack withclearAccessTokenRequirementso auth-exempt commands (includingsetup) skip the global--access-tokenrequirement without breaking subcommand flag validation. Drops registration of thesymbolscommand from the root tree.Library tweak:
InstallResultgainsfailure_reasonfor wizard messaging when auto-install fails but the flow continues.Reviewed by Cursor Bugbot for commit 97c6a7d. Bugbot is set up for automated code reviews on this repo. Configure here.