Skip to content

First-run onboarding: setup wizard, login aliases, Claude integration#190

Merged
jeremy merged 6 commits intomainfrom
onboarding
Mar 4, 2026
Merged

First-run onboarding: setup wizard, login aliases, Claude integration#190
jeremy merged 6 commits intomainfrom
onboarding

Conversation

@jeremy
Copy link
Member

@jeremy jeremy commented Mar 4, 2026

Summary

  • basecamp login / basecamp logout — top-level aliases for auth login/auth logout, backed by shared builders to avoid duplication. basecamp auth login and basecamp auth logout continue to work unchanged. Post-login nudge suggests basecamp setup claude when 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.
  • Claude wizard stepwizardClaude() added to the full setup wizard between config save and success summary. Skips silently when Claude Code is absent. showSuccess checklist includes plugin status.
  • onboarded flag — persistent *bool in config (Onboarded). isFirstRun() checks it before auth/token. runWizard() persists it globally on completion. PersistValue writes native JSON booleans for boolean keys with whitespace tolerance.
  • Docs — README.md and install.md updated from claude plugin install basecamp to basecamp setup claude. Doctor hints aligned.

Marketplace source

The marketplace source is basecamp/claude-plugins — this is the migration target from basecamp/basecamp-cli. Both the source and plugin name are centralized as constants in harness.ClaudeMarketplaceSource and harness.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 via installClaudeNonInteractive(), 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 onboarded flag is a *bool in 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() checks onboarded first, then falls back to auth state and BASECAMP_TOKEN.

Backward compatibility

  • basecamp auth login / basecamp auth logout — unchanged, still work as before
  • basecamp login / basecamp logout — new top-level aliases, both backed by the same shared buildLoginCmd/buildLogoutCmd builders
  • basecamp setup — still runs the full interactive wizard; setup claude is an additive subcommand
  • Existing config files — no schema changes; onboarded is additive (omitempty)

Verification

$ make check
# fmt, vet, lint, test (unit + e2e), naming, surface, provenance — all pass

$ go test ./internal/commands/ ./internal/tui/resolve/ ./internal/harness/ -count=1
ok  github.com/basecamp/basecamp-cli/internal/commands   1.060s
ok  github.com/basecamp/basecamp-cli/internal/tui/resolve 0.676s
ok  github.com/basecamp/basecamp-cli/internal/harness     0.319s

$ make test-e2e
# 257 tests, 0 failures

$ make lint
# 0 issues

Test plan

  • make check passes (fmt, vet, lint, test, test-e2e, naming, surface, provenance)
  • basecamp login / basecamp logout work as top-level commands
  • Fresh user: basecamp → wizard → Claude step offers install → onboarded = true persisted
  • Existing user: basecamp login → post-login nudge: basecamp setup claude
  • basecamp setup claude → marketplace add + plugin install → verified
  • basecamp setup claude --json emits clean JSON only (no prose on stdout)
  • No Claude installed: all Claude UX silently absent

jeremy added 4 commits March 4, 2026 10:47
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.
Copilot AI review requested due to automatic review settings March 4, 2026 18:48
@github-actions github-actions bot added commands CLI command implementations tui Terminal UI tests Tests (unit and e2e) docs breaking Breaking change labels Mar 4, 2026
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

⚠️ Potential breaking changes detected:

  • The 'auth login' and 'auth logout' subcommands were removed.
  • The top-level 'login' and 'logout' commands were added to replace the corresponding 'auth' subcommands. This constitutes a breaking change as the original commands were removed/renamed.
  • The output of the 'setup' command has changed to include steps for Claude Code integration, which may affect scripts parsing its output.

Review carefully before merging. Consider a major version bump.

@github-actions github-actions bot added the enhancement New feature or request label Mar 4, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 logout top-level commands via shared command builders, plus post-login Claude setup nudges.
  • Added basecamp setup claude and integrated Claude plugin installation into the setup wizard + success checklist.
  • Introduced onboarded config 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.

jeremy added 2 commits March 4, 2026 11:06
…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.
Copilot AI review requested due to automatic review settings March 4, 2026 19:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jeremy
Copy link
Member Author

jeremy commented Mar 4, 2026

The breaking change detection is a false positive — auth login and auth logout subcommands were kept intact. The top-level login/logout are aliases, not replacements.

@jeremy jeremy merged commit 0134e10 into main Mar 4, 2026
25 checks passed
@jeremy jeremy deleted the onboarding branch March 4, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change commands CLI command implementations docs enhancement New feature or request tests Tests (unit and e2e) tui Terminal UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants