Skip to content

Add TUI interactive mode and UMAP subcommands - #20

Merged
cpetersen merged 1 commit into
mainfrom
tui-interactive-mode
Mar 27, 2026
Merged

cpetersen merged 1 commit into
mainfrom
tui-interactive-mode

Conversation

@cpetersen

Copy link
Copy Markdown
Member

Summary

  • TUI as default mode: Running ragnar with no arguments now launches a ratatui-based TUI with auto-completion, persistent history, and live output. All CLI commands continue to work normally (e.g. ragnar index .).
  • UMAP subcommands: Moved train-umap/apply-umap to ragnar umap train/ragnar umap apply as a proper Thor subcommand.
  • Progress bar fix: TTY::ProgressBar crashes with ioctl errors in TUI mode (stdout is StringIO). Falls back to text-based progress when ioctl is unavailable.
  • UMAP error resilience: Better error handling for LAPACK and index-out-of-bounds panics with retry logic and clear error messages.
  • Dependency updates: Uses released thor-interactive 0.1.0.pre.6, clusterkit 0.2.6.pre, and ratatui_ruby ~> 1.4.
  • README updates: Added TUI section, corrected UMAP command references, added new dependencies to acknowledgments.

Test plan

  • All specs pass: 310 examples, 0 failures (17 new specs for cli_umap subcommand)
  • ragnar launches TUI
  • ragnar index . works from CLI
  • ragnar umap train and ragnar umap apply work in both CLI and TUI
  • Progress bars display correctly in CLI mode, fall back to text in TUI
  • UMAP training completes successfully with 6938 embeddings (768 dims)

🤖 Generated with Claude Code

…ility

- Add ratatui-based TUI as default mode (`ragnar` launches TUI, CLI commands
  still work normally e.g. `ragnar index .`)
- Move train-umap/apply-umap to `ragnar umap train`/`ragnar umap apply`
  subcommands via new cli_umap.rb
- Fix TTY::ProgressBar ioctl crash in TUI mode by falling back to text
  progress when $stdout doesn't support ioctl (StringIO in TUI)
- Improve UMAP error handling: catch LAPACK and index-out-of-bounds panics
  with retry logic and helpful error messages
- Update error messages to reference new `ragnar umap train` command
- Update Gemfile to use released thor-interactive 0.1.0.pre.6, clusterkit
  0.2.6.pre, and ratatui_ruby
- Update README: new TUI section, corrected UMAP commands, acknowledgments
- Add 17 specs for cli_umap subcommand (310 total, 0 failures)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cpetersen
cpetersen merged commit eb0ab56 into main Mar 27, 2026
1 check passed
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