Skip to content

fix(tui): pick keys, accounts, and models from the CLI - #9

Merged
duyet merged 1 commit into
mainfrom
fix/tui-key-account-switch
Aug 24, 2026
Merged

fix(tui): pick keys, accounts, and models from the CLI#9
duyet merged 1 commit into
mainfrom
fix/tui-key-account-switch

Conversation

@duyet

@duyet duyet commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Why

Pressing Enter on account or api key in Config looked like a no-op. The leftover Enter from the settings screen immediately confirmed the next picker on the current row.

What

  • Drain queued key events before each TUI so nested pickers actually wait for a choice
  • api key opens a newest-first key picker in the CLI (type to search)
  • account opens a profile picker (plus add / re-auth / log out)
  • model uses the TUI search picker (no extra filter prompt)
  • Login prefers the latest revealable key
  • Palette shortcuts: account…, key…, model…
  • Section padding on config + launcher for a less cramped layout

Test

  • cargo test --all-targets
  • cargo check --no-default-features --target wasm32-unknown-unknown
  • --dump-tui frames for menu and config

Settings Enter was still in the input queue, so the next picker
confirmed the current row and switching looked like a no-op.
Drain leftover keys, list API keys newest-first (login prefers
the latest), and open account/key/model pickers in the launcher.
Add section padding so the config and palette screens breathe.

Co-authored-by: Duyet Le <me@duyet.net>
Co-authored-by: duyetbot <bot@duyet.net>
@github-actions

Copy link
Copy Markdown
Contributor

anyr size and startup

Startup is wall time for a cold anyr --version / anyr --help (median of 21 runs). Size is the stripped release binary, or the .wasm for the browser demo.

Size budget: anyr-linux-x86_64 must stay ≤ 4.0 MiB (4194304 bytes) stripped.

Asset Kind Size --version median --help median
anyr-darwin-arm64 native 2.3 MiB 5.29 ms 6.22 ms
anyr-linux-arm64 native 2.3 MiB 0.71 ms 0.74 ms
anyr-linux-x86_64 native 2.6 MiB 0.94 ms 0.93 ms
anyr-windows-x86_64.exe native 2.1 MiB 10.07 ms 9.99 ms
anyr.wasm wasm 170.8 KiB

Budget check: ok

raw timings
[
  {
    "asset": "anyr-darwin-arm64",
    "kind": "native",
    "path": "/Users/runner/work/cli/cli/anyr-darwin-arm64",
    "bytes": 2440456,
    "size": "2.3 MiB",
    "version": "0.1.10 (built 2026-08-24 11:03:07)",
    "target": "aarch64-apple-darwin",
    "os": "macos-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 4.23,
      "median_ms": 5.29,
      "p95_ms": 8.6,
      "mean_ms": 6.07
    },
    "startup_help": {
      "n": 21,
      "min_ms": 3.87,
      "median_ms": 6.22,
      "p95_ms": 8.58,
      "mean_ms": 6.19
    }
  },
  {
    "asset": "anyr-linux-arm64",
    "kind": "native",
    "path": "/home/runner/work/cli/cli/anyr-linux-arm64",
    "bytes": 2429920,
    "size": "2.3 MiB",
    "version": "0.1.10 (built 2026-08-24 11:02:38)",
    "target": "aarch64-unknown-linux-gnu",
    "os": "ubuntu-24.04-arm",
    "startup_version": {
      "n": 21,
      "min_ms": 0.65,
      "median_ms": 0.71,
      "p95_ms": 0.85,
      "mean_ms": 0.72
    },
    "startup_help": {
      "n": 21,
      "min_ms": 0.69,
      "median_ms": 0.74,
      "p95_ms": 0.79,
      "mean_ms": 0.74
    }
  },
  {
    "asset": "anyr-linux-x86_64",
    "kind": "native",
    "path": "/home/runner/work/cli/cli/anyr-linux-x86_64",
    "bytes": 2707344,
    "size": "2.6 MiB",
    "version": "0.1.10 (built 2026-08-24 11:02:51)",
    "target": "x86_64-unknown-linux-gnu",
    "os": "ubuntu-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 0.93,
      "median_ms": 0.94,
      "p95_ms": 1.05,
      "mean_ms": 0.96
    },
    "startup_help": {
      "n": 21,
      "min_ms": 0.92,
      "median_ms": 0.93,
      "p95_ms": 1.05,
      "mean_ms": 0.95
    }
  },
  {
    "asset": "anyr-windows-x86_64.exe",
    "kind": "native",
    "path": "D:\\a\\cli\\cli\\anyr-windows-x86_64.exe",
    "bytes": 2240512,
    "size": "2.1 MiB",
    "version": "0.1.10 (built 2026-08-24T11:03:49Z)",
    "target": "x86_64-pc-windows-msvc",
    "os": "windows-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 9.03,
      "median_ms": 10.07,
      "p95_ms": 12.69,
      "mean_ms": 10.67
    },
    "startup_help": {
      "n": 21,
      "min_ms": 8.75,
      "median_ms": 9.99,
      "p95_ms": 10.74,
      "mean_ms": 9.94
    }
  },
  {
    "asset": "anyr.wasm",
    "kind": "wasm",
    "path": "/home/runner/work/cli/cli/target/wasm-pkg/anyr_cli_bg.wasm",
    "bytes": 174926,
    "size": "170.8 KiB",
    "version": "wasm",
    "target": "wasm32-unknown-unknown",
    "os": ""
  }
]

@duyet
duyet merged commit ad95180 into main Aug 24, 2026
8 checks passed
@duyet
duyet deleted the fix/tui-key-account-switch branch August 24, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant