Skip to content

1 basic chatting interface#8

Open
chengus wants to merge 4 commits intomainfrom
1-basic-chatting-interface
Open

1 basic chatting interface#8
chengus wants to merge 4 commits intomainfrom
1-basic-chatting-interface

Conversation

@chengus
Copy link
Collaborator

@chengus chengus commented Feb 26, 2026

Problems!

Janky outlines, need to resize terminal once to fix it


This pull request integrates OpenRouter chat functionality into the TUI app, enabling users to interact with language models directly from the terminal interface. It introduces a new chat UI, handles streaming responses, manages keyboard shortcuts for navigation and shutdown, and displays model and token usage information.

OpenRouter integration and chat functionality:

  • Added @openrouter/sdk as a dependency in package.json and imported it into the app, enabling communication with the OpenRouter API. [1] [2]
  • Implemented message sending, streaming response handling, and error management using OpenRouter, including environment variable-based API key retrieval and model selection.

User interface and experience improvements:

  • Redesigned the UI to display chat history in a scrollable box, show model information, reasoning token usage, and error messages, and provide an input box for user messages.
  • Added keyboard shortcuts for scrolling (PgUp/PgDn, Ctrl+U/Ctrl+D) and quitting (Esc/Ctrl+C), enhancing usability in the terminal.

App lifecycle management:

  • Introduced proper shutdown handling to abort in-progress requests and exit cleanly on quit commands or renderer destruction.

@chengus chengus linked an issue Feb 26, 2026 that may be closed by this pull request
@chengus chengus requested a review from chenxin-yan February 26, 2026 00:10
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.

basic chatting interface

1 participant