Overview
Replace chalk + ora with Ink to provide a modern, React-based CLI experience similar to modern AI coding agent CLIs.
Current State
- Using
chalk for colors and text styling
- Using
ora for simple spinners
- 10 commands with ~191 instances of chalk/ora usage
- Limited interactivity and visual feedback
Proposed Enhancement
Migrate to Ink (React for CLIs) to provide:
Benefits
- ✅ Rich layouts - Multi-column displays, boxes, panels for better information architecture
- ✅ Live updates - Real-time progress indicators, streaming search results
- ✅ Interactive components - Select menus, inputs, collapsible trees for exploration
- ✅ Better organization - Component-based architecture using React patterns
- ✅ Stateful UI - Proper state management for complex interactions
- ✅ Professional UX - Polished interface matching modern developer tool expectations
Trade-offs
- ⚠️ Larger dependency footprint (Ink + React vs lightweight chalk)
- ⚠️ More complex architecture (component-based vs simple string formatting)
- ⚠️ Migration effort across 10 commands
- ⚠️ Potential terminal compatibility concerns (mitigated by Ink's wide support)
Implementation Plan
Phase 1: Prototype (1 command)
Phase 2: High-Value Commands
Prioritize commands with complex output that benefit most:
Phase 3: Remaining Commands
Phase 4: Polish & Enhancements
Success Metrics
- Commands render cleanly in all major terminals (iTerm2, Terminal.app, Windows Terminal, etc.)
- No performance degradation vs current chalk/ora implementation
- Improved user feedback in survey/dogfooding
- Maintains 100% test coverage
Dependencies
ink: ^4.0.0
react: ^18.0.0
ink-spinner: For loading states
ink-select-input: For interactive menus
ink-text-input: For user input
ink-table: For tabular data
References
Related
Overview
Replace chalk + ora with Ink to provide a modern, React-based CLI experience similar to modern AI coding agent CLIs.
Current State
chalkfor colors and text stylingorafor simple spinnersProposed Enhancement
Migrate to Ink (React for CLIs) to provide:
Benefits
Trade-offs
Implementation Plan
Phase 1: Prototype (1 command)
ink,react, etc.)packages/cli/src/ui/dev searchcommand as prototypePhase 2: High-Value Commands
Prioritize commands with complex output that benefit most:
dev index- Progress bars, file counts, status boarddev stats- Tables, charts, formatted metricsdev explore- Interactive tree/list navigationdev gh- Rich issue/PR display with formattingPhase 3: Remaining Commands
dev init- Welcome screen, setup wizarddev update- Diff display, change summarydev clean- Confirmation prompt, progressdev compact- Optimization metricsdev plan- Task breakdown displayPhase 4: Polish & Enhancements
dev interactivemode for guided explorationSuccess Metrics
Dependencies
ink: ^4.0.0react: ^18.0.0ink-spinner: For loading statesink-select-input: For interactive menusink-text-input: For user inputink-table: For tabular dataReferences
Related