Skip to content

feat(cli): finish standalone TUI entry and model configuration #1098

Closed

Description

@Astro-Han

Problem

The standalone TUI onboarding foundation now exists, but the entry and model-configuration experience is still fragmented:

  • A fresh empty session has little product identity or task guidance.
  • /model lists models across connections but cannot search by model, provider, or connection.
  • /setup stops after provider + API key, even though the connection contract already owns model curation through enabledModelIds.
  • Setup completion still leaves the running TUI with a stale model-choice snapshot, so newly configured models are not immediately available from /model.

This issue originally tracked first-run onboarding. It now tracks the smallest coherent completion of that standalone TUI entry and configuration journey.

Desired outcome

Empty-session home

  • Render a compact four-line lowercase ASCII maka wordmark in Maka blue.
  • Present a short Chinese-first tagline and static command-center hints for direct input, /session, /model, and /setup.
  • Keep focus in the bottom editor; the home content is informative, not a second interactive menu.
  • Show the same home after /new; fall back to a plain maka mark when the terminal is too narrow for the ASCII wordmark.

Searchable /model

  • Keep the existing cross-connection model list and session rebinding behavior.
  • Add one bottom search field that matches model ID/display name, provider label/type, and connection name/slug.
  • Keep a bounded visible result list with clear current/connection metadata, an empty state, and ↑↓ / Enter / Esc behavior.
  • Leave typed /model <id> behavior unchanged.

Three-step /setup

  1. Search providers; mark existing connections as 已设置.
  2. Enter and verify an API key. Existing connections may leave the field blank to reuse the stored secret or enter a new value to rotate it.
  3. Search and multi-select enabled models. New connections start with no models selected; existing connections preserve their enabled set. Space toggles selection and at least one model is required before saving.

Navigation and state rules:

  • Esc always moves back one level: models → key → provider → close.
  • Query, draft, and selection state survive while the wizard remains open.
  • Late async verification results cannot overwrite a screen the user has already left.
  • Loading, errors, empty results, saving, and success remain inside the bottom frame; they do not append a transcript Note.
  • Success shows the enabled-model count and closes on Enter.

Activation rules:

  • Saving authoritatively refreshes the running TUI's ready model choices, so the new models are immediately available from /model.
  • Setup does not automatically switch the current session.
  • Setup only establishes a default connection when no default exists, including first run; in-session setup does not replace an existing default.
  • User-facing default-model selection is not part of /setup; storage only maintains the valid compatibility value required by the existing connection contract.

Delivery

Completed foundation:

Remaining independently mergeable seams:

  • Seam 1 — redesign the empty-session home
  • Seam 2 — add searchable cross-connection /model
  • Seam 3 — complete /setup model curation and live model-choice refresh

Each seam starts from the latest main, has its own worktree/branch/PR, and remains independently revertible.

Out of scope

  • OAuth login flows
  • Custom Base URL provider onboarding
  • Manual model-ID entry
  • Global/user default-model settings
  • Automatically switching the active session after setup

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions