feat: make setup wizard the first-use front door - #296
Conversation
📝 WalkthroughWalkthroughThe PR changes guided setup into a numbered, confirmation-based terminal wizard with back/cancel handling and invalid-choice recovery. README and CLI documentation now prioritize the wizard and Browser Console, while tests validate the revised prompts, flow, and onboarding content. ChangesGuided setup experience
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant TerminalWizard
participant SetupFlow
User->>TerminalWizard: Choose a numbered or named starting point
TerminalWizard->>TerminalWizard: Validate and display the selected path
User->>TerminalWizard: Confirm, go back, or cancel
TerminalWizard->>SetupFlow: Continue with the confirmed setup path
Possibly related issues
Possibly related PRs
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (2 errors)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Line 51: Update the README setup-path sentence to avoid claiming that the
Browser Console supports local executable and existing client-entry imports;
list only the Console paths documented in docs/cli.md, while preserving the
broader terminal wizard capabilities.
In `@tests/readme-product-contract.test.ts`:
- Around line 95-98: Update the quickStart extraction in the readme contract
test to assert that both section headings are present and that the end heading
index follows the start heading index before calling slice. Preserve the
existing section-boundary strings and only slice after these validations
succeed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 8a137d41-7da3-4588-b03f-fb762c7c312c
📒 Files selected for processing (9)
CHANGELOG.mdREADME.mddocs/cli.mddocs/presets-and-clients.mddocs/whats-new-in-0.5.mdsrc/cli/parse.tssrc/cli/setup.tstests/readme-product-contract.test.tstests/setup-command.test.ts
|
CI follow-up: macOS Node 24 timed out in the unchanged |
All actionable findings were fixed in bd8da38; CodeRabbit rechecked and explicitly confirmed both resolved threads on the current head.
Summary
miftah setupvisibly present a numbered terminal wizard with explicit Step 1 and Step 2 statesmiftah setupand themiftah dashboardbrowser Console before the optional scriptedinitexample in the READMEmiftah consoleAPI command and update CLI/setup reference docsSecurity and compatibility
The change does not alter setup planners, config writers, imports, credential handling, OAuth ownership, provider adapters, subprocess execution, no-shell behavior, non-overwrite publication, redaction, audit, containment, timeouts, or public configuration/API contracts. Existing source aliases remain accepted.
TDD evidence
The new setup and README contracts failed first against the previous unnumbered prompt and scripted-first quick start. After the implementation, the focused setup/README/0.5 guide/CLI contracts pass (125 tests), including numeric selection, safe back, cancel-before-write, and current-step invalid-input recovery. A direct built-CLI TTY dogfood also confirmed number -> Back -> cancel with no output file.
Validation
Run on Node 22.22.3:
npm test— 1,783 passed, 33 expected skipsnpm run test:core— 425 passed, 26 expected skipsnpm run test:coverage— 1,783 passed, 33 expected skips; 95.65% statements, 91.89% branches, 98.66% functionsnpm run lintnpm run typechecknpm run buildnpm run smoke:clinpm run check:pack— 48 files verifiednpm run test:package— 26 passedOne earlier aggregate
npm testattempt exposed the existing OAuth registry host-contention timeout; the exact test passed alone in 58 ms, passed under full coverage, and passed in the clean full-suite rerun. No timeout or test setting was changed.Tracks #204. This PR does not close #204 or claim its external evaluator acceptance; #25/#88 evidence remains open.
Summary by CodeRabbit
New Features
Documentation