Story/jwill9999 cli polish - #14
Merged
Merged
Conversation
…d, visual polish UI/theming,Rendering,Spinners:Models,Error logging BREAKING CHANGE: ask now defaults to non-stream and md rendering; pass --stream to streamREPL starts with streaming off and md for non-stream outputs; toggle with /stream on|off, /format md|plain
There was a problem hiding this comment.
Pull Request Overview
This PR adds significant UI/UX polish and functional improvements to the OpenRouter CLI tool, transforming it from a basic CLI into a more user-friendly and feature-rich application. The changes include visual theming, interactive model selection, improved error handling, and enhanced rendering capabilities.
Key changes:
- UI Enhancement: Added styled banners, color palette, spinners, and formatted help with examples
- Interactive Features: Integrated fuzzy model search with autocomplete and caching capabilities
- Improved Defaults: Changed to non-streaming mode with markdown rendering by default for better readability
Reviewed Changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/shared/ui.ts |
New module providing color-aware theming, styled components (banners, headers, footers), and spinner utilities |
src/shared/models.ts |
New module implementing model caching, fuzzy search via Fuse.js, and debounced autocomplete suggestions |
src/shared/logger.ts |
New error logging system writing to ~/.config/openrouter-cli/cli.log |
src/shared/openrouter.ts |
Added listModels API and UI hooks (onFirstToken, onDone) for spinner integration |
src/shared/format.ts |
Enhanced markdown rendering with bold/italic inline formatting support |
src/main.ts |
Integrated styled help, spinners, and changed default behavior to non-streaming with markdown |
src/repl.ts |
Updated with styled prompts, tips, spinner integration, and improved error handling |
src/shared/init.ts |
Added interactive model picker using enquirer with fuzzy search capabilities |
src/commands/models.ts |
New command for interactive/non-interactive model browsing with table output |
tests/*.spec.ts |
Added comprehensive test coverage for new UI, models, and help functionality |
package.json |
Added UI dependencies: boxen, chalk, cli-table3, ora, enquirer, fuse.js |
eslint.config.js |
Enhanced TypeScript unused variables rule configuration |
|
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
UI/theming: add banner, palette, styled help (banner + examples), REPL prompt/tips; non-stream answer header/footer
Rendering: support bold/italic inline; keep streaming raw; md rendering for non-stream
Spinners: add “Thinking” indicator for ask (non/stream) and REPL (non/stream; stream until first token)
Models: add listModels API and shared/models (TTL cache + fuzzy via Fuse); new models [query] cmd (interactive autocomplete in TTY, table fallback); integrate picker into init (OpenRouter-only), stable suggest mapping
Enquirer: robust prompt resolution for ESM/CJS; fix autocomplete choice mapping; avoid debounce spinner conflicts
Defaults: ask format=md and non-stream by default; REPL format=md and streaming off by default
Error handling: add file logger (~/.config/openrouter-cli/cli.log), top-level friendly error message; REPL logs errors with context
CLI polish: NO_COLOR/TTY-aware colors; help/tests updated
Tests: add models.spec (fuzzy + cache), help-style, ui-answer; all green
Docs: add existing_structure.md
Chore: add TODO.local.md (ignored), expand .gitignore; ESLint TS unused-vars rule
BREAKING CHANGE: