Skip to content

Add accounts command and improve account selection UX#261

Merged
jeremy merged 1 commit intomainfrom
pr/account-switching
Mar 11, 2026
Merged

Add accounts command and improve account selection UX#261
jeremy merged 1 commit intomainfrom
pr/account-switching

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 11, 2026

Summary

  • add accounts list and accounts use commands
  • improve single-account auto-selection messaging in the wizard
  • keep the command catalog and CLI surface in sync for the new auth commands

Testing

  • bin/ci

Summary by cubic

Add an accounts command group (alias: account) to list authorized Basecamp accounts and set the default from the CLI. Also improves the account selection wizard by confirming single-account auto-select and keeps the command catalog and CLI surface in sync.

  • New Features
    • basecamp accounts list shows authorized accounts (id, name, href) with a count and next-step breadcrumbs.
    • basecamp accounts use <id> --scope [global|local] validates id/scope, persists the canonical id (global or local), and prints a clear summary with helpful breadcrumbs.
    • Wizard confirms when a single account is auto-selected; resolver adds Label for selected accounts and exposes ListAccounts.
    • Command catalog, root command, tests, and .surface updated to include the new group.

Written for commit 27bdd8c. Summary will update on new commits.

@jeremy jeremy requested a review from a team as a code owner March 11, 2026 03:50
Copilot AI review requested due to automatic review settings March 11, 2026 03:50
@github-actions github-actions bot added commands CLI command implementations tui Terminal UI tests Tests (unit and e2e) enhancement New feature or request labels Mar 11, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 7 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/commands/accounts.go">

<violation number="1" location="internal/commands/accounts.go:129">
P1: Persist the canonical account ID, not the raw CLI argument. If the user passes `007`, `ParseInt` yields `7` but the raw string `"007"` is written to config. Use `strconv.FormatInt(accountID, 10)` (or the existing `resolve.PersistAccountID` helper) so the persisted value always matches the canonical form.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Copy Markdown

@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: 452d0b9dd6

ℹ️ 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
Copy Markdown

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 a first-class accounts command group to manage authorized Basecamp accounts, and tweaks the setup wizard to better communicate the single-account auto-selection path, while keeping the command catalog and CLI surface snapshot consistent.

Changes:

  • Introduce basecamp accounts list and basecamp accounts use <id> commands.
  • Enhance resolver/wizard UX by attaching an account label for single-account auto-selection and printing a confirmation in the wizard.
  • Register the new command in the CLI root, command catalog, and .surface snapshot/testing harness.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
internal/tui/resolve/account.go Adds Label on single-account default selection and exposes ListAccounts() via the resolver.
internal/commands/wizard.go Prints an additional message when a single account is auto-selected.
internal/commands/commands_test.go Registers accounts in the test root command to keep catalog/surface tests aligned.
internal/commands/commands.go Adds accounts to the command catalog under “Auth & Config”.
internal/commands/accounts.go New command implementation for listing accounts and persisting a default account.
internal/cli/root.go Registers the new accounts command in the real CLI root.
.surface Updates CLI surface snapshot for new commands/flags/subcommands.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jeremy jeremy force-pushed the pr/account-switching branch from 452d0b9 to 27bdd8c Compare March 11, 2026 04:30
@jeremy jeremy merged commit 65c3164 into main Mar 11, 2026
25 checks passed
@jeremy jeremy deleted the pr/account-switching branch March 11, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands CLI command implementations 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