feat(scripts): bootstrap.ps1 — single-paste cold-start with batched OAuth#31
Open
abdout wants to merge 3 commits into
Open
feat(scripts): bootstrap.ps1 — single-paste cold-start with batched OAuth#31abdout wants to merge 3 commits into
abdout wants to merge 3 commits into
Conversation
…Auth Implements spec #28. One paste, one UAC, three OAuth sign-ins at the end. irm https://kun.databayt.org/install | iex The 16-step flow: [0] ExecutionPolicy → RemoteSigned [1] Self-elevation (one UAC prompt) [2] OS + PowerShell version check [3] Log dir + per-run log file [4] winget bundle: Git, Node-LTS, gh, pwsh, Claude Code CLI, Claude Desktop [5] PATH refresh in current session [6] npm install -g pnpm [7] WebStorm (direct install; Toolbox fallback TODO) [8] Claude Code [Beta] plugin (manual today; auto pre-drop TODO) [9] Fetch + run install.ps1 (kun config copy) [10] settings.json drop (handled by install.ps1) [11] Append c/cc block to $PROFILE [12] OAuth batch: gh + claude + JetBrains, one tab at a time [13] secrets.ps1 -GistId <id> [14] sync-repos.ps1 — clone every org repo [15] maintain -Install — arm the daily heartbeat [16] doctor.ps1 — final verify; bootstrap exits with doctor's exit code Flags: -Role engineer|business|content|ops -GistId <id> override secrets Gist -Track future: GitHub progress issue (TODO) -DryRun no side effects; verified working -SkipOAuth skip the 3-sign-in batch (testing) -SkipWebStorm skip IDE install -SkipCowork skip Claude Desktop install New helper modules in lib/: - Bootstrap-Common.ps1 numbered [N/16] step output + log tee + beep - Confirm-Admin.ps1 elevation check (no auto-relaunch — too brittle for irm) - Install-Winget.ps1 idempotent wrapper, retry-once on transients - Update-Path.ps1 refresh PATH from machine+user registry - Stage-OAuth.ps1 3-tab batch with beep + Enter gates Self-fetches lib/ files from GitHub when run via `irm | iex` (no local repo). Idempotent — re-runnable; healthy machine finishes in <60s with all skips. Verified end-to-end via -DryRun -SkipOAuth -SkipWebStorm. Open items tracked in spec #28 (do not block): - Toolbox fallback path if direct WebStorm install ships broken JBR - Plugin pre-drop URL — Marketplace ID needs verification - -Track flag (GitHub progress issue) — nice-to-have polish Closes #28 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Addresses three of the four open questions from spec #28: 1. **JetBrains plugin auto pre-drop** — new lib/Drop-Plugin.ps1. Verified API endpoints (2026-05-16): - latest version: GET /api/plugins/27310/updates?channel=&size=1 - download: GET /files/{file from API response} Plugin 27310 ('Claude Code [Beta]', xmlId com.anthropic.code.plugin). Step 8 in bootstrap.ps1 now downloads + extracts into %APPDATA%\JetBrains\WebStorm*\plugins\, idempotent (skips if already loaded), falls back to a manual instruction on failure. 2. **/install redirect** — next.config.ts now redirects: /install → raw.githubusercontent.com/databayt/kun/main/.claude/scripts/bootstrap.ps1 /finish → bootstrap.ps1 (alias for resume) /doctor → doctor.ps1 (standalone download) Makes the canonical paste `irm https://kun.databayt.org/install | iex` actually work end-to-end. 3. **Confirmed winget package IDs** via `winget search Anthropic`: Anthropic.Claude → Claude Desktop Anthropic.ClaudeCode → Claude Code CLI Both IDs match what bootstrap.ps1 already uses. No code change needed; spec #28 open question resolved. Remaining open item: direct `winget install JetBrains.WebStorm` JBR completeness — needs fresh-VM verification before flipping the bootstrap default. Doesn't block this PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Update — addressed 3 of 4 open questions from spec #28:
PR is now closer to "merge and try on a clean VM" than "still architecting." |
Resolves the spec #26 acceptance criterion 'repositories.json becomes the source of truth (both doctor.ps1 and sync-repos.ps1 read it)'. - repositories.json gains a top-level 'repos' map keyed by repo name, values as $env:USERPROFILE-expanded paths. Sits alongside the richer 'repositories' object (untouched, for other tooling). - sync-repos.ps1 reads repositories.json's 'repos' map at runtime, expands env vars via ExpandString. Falls back to the previously- hardcoded hashtable when the JSON isn't yet at the install location (cold-bootstrap edge case). - Path expansion verified end-to-end on this machine — '$env:USERPROFILE\codebase' resolves to 'C:\Users\osman\codebase'. doctor.ps1's Check-Repos.ps1 already reads the same shape (shipped in PR #29). Both scripts now share a single source of truth, so adding a new active repo means editing one JSON file. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
abdout
added a commit
that referenced
this pull request
May 16, 2026
Reflects the reality on the ground after PRs #29/#30/#31 land the v2 scripts: onboarding.mdx: - Promotes 'irm https://kun.databayt.org/install | iex' to the recommended path (one paste, one UAC, three OAuth sign-ins) - Demotes Cowork-driven flow to "Alternative" — still works for Pro/Max users who want narration over a bare paste - Manual fallback updated to use databayt/kun raw URL (the codebase one is now tombstoned in databayt/codebase#2) - Adds 'doctor' to Daily entry points and 'maintain -Install' to the manual fallback chain - "What you end up with" mentions the scheduled task onboarding-reference.mdx: - Scripts contract table flipped: bootstrap, doctor, maintain are now Shipping (no longer 'Planned v2'); health.ps1 marked Deprecated; finish.ps1 reduced to 'Planned (alias for bootstrap)' - Source-of-truth URL changed from databayt/codebase to databayt/kun - Migration order section refreshed — 4 of 6 items checked off, fresh-VM test + team comms remaining Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 16, 2026
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.
Summary
Implements spec #28. The single-paste cold-start — paste one line, click one UAC, batch three OAuth sign-ins at the end, walk away.
Builds on #29 (doctor) and #30 (maintain) — bootstrap's final step is
doctor; step 15 callsmaintain -Installto arm the daily heartbeat.What's in the PR
~/.claude/scripts/bootstrap.ps1(260 lines) — the 16-step orchestratorlib/:Bootstrap-Common.ps1— numbered[N/16]step output, log tee, attention beepConfirm-Admin.ps1— elevation check (no auto-relaunch — too brittle insideirm | iex)Install-Winget.ps1— idempotent wrapper, retry-once on transient failuresUpdate-Path.ps1— refresh$env:Pathfrom machine + user registryStage-OAuth.ps1— 3-tab OAuth batch with beep + Enter gates between sign-insThe 16-step flow
Start-Process -Verb RunAs)npm install -g pnpm-SkipWebStormavailable)c/ccblock to$PROFILE(reusesFix-Shell.ps1from #29)secrets.ps1 -GistId <id>sync-repos.ps1— clone every org repomaintain -Install— arm daily heartbeatdoctor.ps1— final verifyFlags
-Role-GistId-DryRun-SkipOAuth-SkipWebStorm-SkipCowork-TrackIdempotency
Every step has a skip-if-already-done check. Re-running on a healthy machine completes in under a minute with all skips. There is no separate "fresh install" mode — to redo, delete
~/.claude/first.irm | iexself-fetchWhen run via the canonical paste, the script can't find
lib/files on disk (they're in the repo, not next to bootstrap). It detects this and downloads them fromraw.githubusercontent.com/databayt/kun/main/.claude/scripts/lib/into a temp dir before sourcing.Exit codes (mirror doctor's)
0123Verified locally
bootstrap.ps1 -DryRun -SkipOAuth -SkipWebStormruns the full 16-step flow on this machine, writes a log to~/.claude/logs/bootstrap-<ts>.log, and exits cleanly. All 6 PowerShell files parse without errors.TODOs not blocking this PR (tracked in spec #28)
wingetinstall still ships broken JBR-Trackflag (GitHub progress issue)Anthropic.Claudewinget package IDwinget search Anthropicverification on clean VMTest plan
Parser::ParseFilebootstrap.ps1 -DryRun -SkipOAuth -SkipWebStormruns end-to-end on this dev machineirm | iex, click UAC, complete 3 OAuth, full successcworks in a fresh PowerShell,doctorexits 0The fresh-VM test is the only true acceptance gate (spec §10).
Dependencies
This branch stacks on
feat/maintain(PR #30), which stacks onfeat/doctor(PR #29). Merge order:Closes #28
🤖 Generated with Claude Code