File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ dependencies = [
2626 " markitdown[pptx]" ,
2727 " markitdown[xls]" ,
2828 " markitdown[xlsx]" ,
29+ " prompt-toolkit" ,
2930 " sqlite-ai" ,
3031 " sqlite-vector"
3132]
Original file line number Diff line number Diff line change 77from typing import Optional
88
99import typer
10+ from prompt_toolkit import prompt
11+ from prompt_toolkit .history import InMemoryHistory
1012
1113from sqlite_rag .database import Database
1214from sqlite_rag .settings import SettingsManager
@@ -477,17 +479,23 @@ def download_model(
477479
478480
479481def repl_mode ():
480- """Interactive REPL mode"""
482+ """Interactive REPL mode with arrow key support """
481483 typer .echo ("Entering interactive mode. Type 'help' for commands or 'exit' to quit." )
482484 typer .echo (
483485 "Note: --database and configure commands are not available in REPL mode."
484486 )
485487
486488 disabled_features = ["configure" , "--database" , "-db" ]
489+ history = InMemoryHistory ()
487490
488491 while True :
489492 try :
490- command = input ("\n sqlite-rag> " ).strip ()
493+ command = prompt (
494+ "sqlite-rag> " ,
495+ history = history ,
496+ enable_history_search = True ,
497+ ).strip ()
498+
491499 if not command :
492500 continue
493501
You can’t perform that action at this time.
0 commit comments