First-run onboarding: setup wizard, login aliases, Claude integration#190
First-run onboarding: setup wizard, login aliases, Claude integration#190
Conversation
IsPluginNeeded() and FindClaudeBinary() in harness/claude.go support the upcoming wizard Claude step. Onboarded *bool field in config enables persistent first-run gating. PersistValue now writes native JSON booleans for boolean config keys (onboarded, hints, stats, cache_enabled) with whitespace tolerance. Doctor hints updated to recommend `basecamp setup claude` as the canonical plugin install path.
Expose `basecamp login` and `basecamp logout` as first-class commands alongside the existing `basecamp auth login/logout`. Both pairs delegate to shared buildLoginCmd/buildLogoutCmd helpers to avoid duplication. Post-login nudge prints `basecamp setup claude` when Claude Code is detected but the plugin is missing.
wizardClaude() offers interactive plugin install via two-step marketplace flow (marketplace add + plugin install). setup becomes a parent command with `setup claude` subcommand for focused plugin setup. isFirstRun() now checks the persistent onboarded flag. runWizard() persists onboarded on completion. quickstart adds Claude breadcrumb when plugin is needed. setup claude --json/--agent emits clean structured output (no prose) with 3-state summary: not detected / not installed / installed.
README and install.md previously recommended `claude plugin install basecamp` directly. Now points to `basecamp setup claude` which handles marketplace registration and plugin install in one command.
Review carefully before merging. Consider a major version bump. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b591dd470
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds first-run onboarding improvements by introducing a setup wizard Claude Code step, a dedicated basecamp setup claude installer, and top-level login/logout aliases, while persisting an onboarded flag in config to suppress repeat onboarding.
Changes:
- Added
basecamp login/basecamp logouttop-level commands via shared command builders, plus post-login Claude setup nudges. - Added
basecamp setup claudeand integrated Claude plugin installation into the setup wizard + success checklist. - Introduced
onboardedconfig flag and updated config persistence to write native JSON booleans (with tests), plus docs updates for the new Claude setup flow.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/tui/resolve/persist_test.go | New tests ensuring boolean config keys persist as JSON booleans (incl. whitespace tolerance). |
| internal/tui/resolve/persist.go | Persist boolean keys as native JSON booleans (not strings). |
| internal/harness/claude.go | Adds Claude binary discovery + plugin-needed helper; updates doctor hint to basecamp setup claude. |
| internal/config/config.go | Adds Onboarded *bool to config + loads it from JSON. |
| internal/commands/wizard_test.go | Adds tests for onboarded first-run behavior and setup claude JSON output/summary states. |
| internal/commands/wizard.go | Adds setup claude subcommand and wizard Claude step; persists onboarded. |
| internal/commands/quickstart.go | Adds quick-start breadcrumb suggesting basecamp setup claude when needed. |
| internal/commands/config.go | Adds onboarded as a valid config set key with boolean parsing. |
| internal/commands/commands_test.go | Ensures catalog test registers new top-level login/logout commands. |
| internal/commands/commands.go | Adds login/logout to the command catalog. |
| internal/commands/auth.go | Refactors login/logout into shared builders; adds Claude nudge after login. |
| internal/cli/root.go | Registers new top-level login/logout commands. |
| install.md | Updates Claude install instructions to basecamp setup claude. |
| README.md | Updates Claude install one-liner to basecamp setup claude. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ck, test robustness - setup claude now attempts install in non-interactive mode (--json/--agent) via installClaudeNonInteractive(), so automation workflows get the plugin - wizardClaude falls back to FindClaudeBinary() when ~/.claude dir is absent but the binary exists (fresh install scenario) - onboarded flag always persists globally, independent of config scope choice - PersistValue error for onboarded now warns to stderr instead of silent ignore - FindClaudeBinary guards against empty home directory from os.UserHomeDir - Tests use require.NoError for os.MkdirAll/os.WriteFile setup calls
Single-point-of-change for the marketplace migration from basecamp/basecamp-cli to basecamp/claude-plugins. All exec args and manual install hints now reference harness.ClaudeMarketplaceSource and harness.ClaudePluginName.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The breaking change detection is a false positive — |
Summary
basecamp login/basecamp logout— top-level aliases forauth login/auth logout, backed by shared builders to avoid duplication.basecamp auth loginandbasecamp auth logoutcontinue to work unchanged. Post-login nudge suggestsbasecamp setup claudewhen Claude Code is detected but the plugin is missing.basecamp setup claude— focused subcommand that registers the marketplace and installs the plugin. Marketplace add is best-effort; plugin install always attempted.wizardClaude()added to the full setup wizard between config save and success summary. Skips silently when Claude Code is absent.showSuccesschecklist includes plugin status.onboardedflag — persistent*boolin config (Onboarded).isFirstRun()checks it before auth/token.runWizard()persists it globally on completion.PersistValuewrites native JSON booleans for boolean keys with whitespace tolerance.claude plugin install basecamptobasecamp setup claude. Doctor hints aligned.Marketplace source
The marketplace source is
basecamp/claude-plugins— this is the migration target frombasecamp/basecamp-cli. Both the source and plugin name are centralized as constants inharness.ClaudeMarketplaceSourceandharness.ClaudePluginName, so the final cutover is a one-line change.Machine mode behavior (
--json/--agent/--quiet)basecamp setup claude --json(and--agent,--quiet) now attempts plugin installation without prompts viainstallClaudeNonInteractive(), then reports structured results. Previous behavior was report-only (no install attempt). Output is always clean JSON with no interleaved prose on stdout:{ "ok": true, "data": { "claude_detected": true, "plugin_installed": false }, "summary": "Claude Code plugin not installed" }Three-state summary:
Claude Code not detected/Claude Code plugin not installed/Claude Code plugin installed.First-run gating (
onboarded)The
onboardedflag is a*boolin config, always persisted to global scope (~/.config/basecamp/config.json) regardless of the user's "save defaults" choice. This ensures the wizard doesn't reappear in other directories.isFirstRun()checksonboardedfirst, then falls back to auth state andBASECAMP_TOKEN.Backward compatibility
basecamp auth login/basecamp auth logout— unchanged, still work as beforebasecamp login/basecamp logout— new top-level aliases, both backed by the same sharedbuildLoginCmd/buildLogoutCmdbuildersbasecamp setup— still runs the full interactive wizard;setup claudeis an additive subcommandonboardedis additive (omitempty)Verification
Test plan
make checkpasses (fmt, vet, lint, test, test-e2e, naming, surface, provenance)basecamp login/basecamp logoutwork as top-level commandsbasecamp→ wizard → Claude step offers install →onboarded = truepersistedbasecamp login→ post-login nudge:basecamp setup claudebasecamp setup claude→ marketplace add + plugin install → verifiedbasecamp setup claude --jsonemits clean JSON only (no prose on stdout)