Skip to content

feat(cli): add commands, onboarding, and interactive chat screen (ENG-383) - #6

Merged
folathecoder merged 2 commits into
mainfrom
folathecoder/eng-383-7-the-cli-commands-onboarding-and-chat-screen
Oct 18, 2026
Merged

folathecoder merged 2 commits into
mainfrom
folathecoder/eng-383-7-the-cli-commands-onboarding-and-chat-screen

Conversation

@folathecoder

@folathecoder folathecoder commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Builds and polishes the terminal experience for Aldwin 0.0.1: the aldwin, aldwin setup, and aldwin uninstall [--purge] commands, the first-run onboarding flow with zero-echo secret input, and the inline scrollback chat screen with streaming markdown, single-line tool cards, collapsible single-key approvals, curated /model picker, remaining-context status bar, and instant Esc stop. All CLI modules communicate exclusively through aldwin.client and aldwin.protocol without importing aldwin.core or agentling.

Ticket

Closes ENG-383
Closes ENG-393
Closes ENG-396
Closes ENG-400

Changes

  • Theme & Colour Hierarchy (src/aldwin/cli/theme.py): Semantic Rich THEME where reply prose uses the terminal's default foreground (fg), metadata/user input use muted (grey50), code and the › pointer use cyan, outcomes use green/red, and approvals use yellow. Overrides prompt_toolkit defaults with PROMPT_STYLE (noreverse toolbar) and adds context_left_percent() and filter_canonical_models().
  • Inline Renderer & Collapsible Approvals (src/aldwin/cli/render.py): Fence-aware split_markdown_blocks with blank-line separation between blocks/lists; human-readable tool argument formatting (format_display_args, including persona.md · N lines for set_persona); single-line ✓/✗ tool rows truncated with ellipsis; and transient approval panels that collapse into ✓ approved <target> / ✗ declined <target> after answering.
  • Serialized Approvals & Command-Only Timing (src/aldwin/host/runner.py, src/aldwin/core/tools/): ApprovalBroker.ask() serializes concurrent approval requests with an asyncio.Lock, and RunCommandTool / SetPersonaTool record post-approval execution duration_ms on ToolOutput so user decision time is excluded.
  • Onboarding & Setup (src/aldwin/cli/onboarding.py): _HiddenInputProcessor hides API keys completely while typing/pasting (no wrapped lines of ***), confirms with Checking key… sk-…a1b2 ✓, and skips the duplicate welcome header when transitioning into chat.
  • Slash Commands & Curated /model Picker (src/aldwin/cli/commands.py): SlashCompleter, indented Table.grid output for /skills (• bullets), /tools, and /help, and canonical model filtering on /model (with /model all to list all dated snapshots).
  • Chat Screen & Status Line (src/aldwin/cli/chat_screen.py): Framed › input prompt, <model> · <N>% context left ? shortcuts · esc stop bottom status line, ? shortcut help, TurnKeyListener (50 ms flush_keys() timeout for bare Esc), and Ctrl-C/Ctrl-D exit handling.
  • Base Instructions & Persona (src/aldwin/core/assets/): Instructs the model to call run_command and set_persona directly (since the app handles the y/n approval box) and never truncate requested long-form answers.

How it was tested

  • Automated:
    • uv run pytest --cov=aldwin -> 207 passed, 1 deselected in 3.16s (92% total coverage; 89% across src/aldwin/cli/).
    • uv run ruff check src tests and uv run ruff format --check src tests -> 0 issues.
    • uv run mypy src tests -> Success: no issues found in 61 source files.
  • Manual:
    • End-to-end interactive verification (TC-15) covering onboarding, remember/recall, web_search/web_fetch, run_command approval, set_persona approval, Esc mid-stream stop, and /model.

Screenshots / recordings

  • Attach the terminal screenshots / 30-second recording from TC-15.

Notes for reviewers

  • Full-screen alternate-buffer TUI (aldwin tui) and ! shell mode are tracked separately in ENG-398 / 0.0.2.

Folarin Akinloye added 2 commits October 18, 2026 13:10
…-383)

Implement the terminal door (aldwin.cli) on top of Typer, Rich, and prompt_toolkit, plus the door-safe setup and inspection bridge in aldwin.client and aldwin.host.in_process.
Use default foreground for replies, collapse approvals into one-line records, serialize concurrent approval prompts, exclude approval wait time from tool durations, hide secret key input during onboarding, and show remaining context percentage in the bottom status line.
@folathecoder
folathecoder merged commit a5dd5c5 into main Oct 18, 2026
4 checks passed
@folathecoder
folathecoder deleted the folathecoder/eng-383-7-the-cli-commands-onboarding-and-chat-screen branch October 18, 2026 14:17
@folathecoder folathecoder self-assigned this Oct 18, 2026
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