Skip to content

feat(cli): interactive picker for configure when multiple mailboxes are configured across providers #37

@stevenobiajulu

Description

@stevenobiajulu

Summary

When more than one mailbox or provider is already configured, email-agent-mcp configure should present an interactive picker rather than requiring the user to remember exact provider names and mailbox aliases on the command line.

Current behavior

Today, the CLI requires the user to know:

  1. Which provider flag to pass (--provider microsoft or --provider gmail)
  2. Which --mailbox alias they previously used (defaults to default)

If the user runs npx email-agent-mcp configure with no flags, it silently defaults to --provider microsoft (see runConfigure in packages/email-mcp/src/cli.ts:857). For users who set up Gmail months ago, this means typing the wrong command and reauthenticating the wrong account, or hitting trial-and-error until the right combination works.

Desired behavior

If configure is run interactively (TTY) and there is more than one mailbox already configured, present a picker that lists them by:

  • email address (the human-meaningful identifier)
  • provider (microsoft / gmail)
  • mailbox alias (the existing CLI key)
  • last-authenticated timestamp (so the user can see which one is stale)

Example (illustrative — exact UX is up to the implementer):

? Which mailbox do you want to (re)authenticate?
  1) steven@usejunior.com           microsoft  alias: work     last auth: 2026-01-12
  2) steven.obiajulu@gmail.com      gmail      alias: personal last auth: 2025-11-03
  3) [add a new mailbox]

Selecting an existing mailbox should run the reauth flow for that exact provider + alias combination. Selecting "add new" should fall through to the existing wizard flow.

Notes

  • The smart-default wizard in cli.ts already runs a runWizardMenu when there are existing mailboxes and the user runs npx email-agent-mcp with no command. That wizard could be extended to handle the configure command too, or the picker logic could be lifted into a shared helper.
  • For non-TTY callers (CI, MCP host startup), keep the existing flag-driven behavior — the picker should only activate in TTY mode.
  • This is a small change but it removes a meaningful papercut for users who don't touch the CLI weekly.

Why this matters

Users who reauthenticate weeks or months after initial setup have to remember exact provider and alias names to pick the right mailbox. A picker removes that memorization burden and eliminates a class of "I reauthed the wrong account" mistakes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions