diff --git a/docs/cli.md b/docs/cli.md index efedc679..3c857cd5 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -66,6 +66,13 @@ haiku-rag ask "Who is the author of haiku.rag?" The QA agent will search your documents for relevant information and provide a comprehensive answer. +## Configuration + +View current configuration settings: +```bash +haiku-rag settings +``` + ## Server Start the MCP server: diff --git a/src/haiku/rag/app.py b/src/haiku/rag/app.py index e7d483e1..dedfce4c 100644 --- a/src/haiku/rag/app.py +++ b/src/haiku/rag/app.py @@ -97,6 +97,26 @@ class HaikuRAGApp: except Exception as e: self.console.print(f"[red]Error rebuilding database: {e}[/red]") + def show_settings(self): + """Display current configuration settings.""" + self.console.print("[bold]haiku.rag configuration[/bold]") + self.console.print() + + # Get all config fields dynamically + for field_name, field_value in Config.model_dump().items(): + # Format the display value + if isinstance(field_value, str) and ( + "key" in field_name.lower() + or "password" in field_name.lower() + or "token" in field_name.lower() + ): + # Hide sensitive values but show if they're set + display_value = "✓ Set" if field_value else "✗ Not set" + else: + display_value = field_value + + self.console.print(f" [cyan]{field_name}[/cyan]: {display_value}") + def _rich_print_document(self, doc: Document, truncate: bool = False): """Format a document for display.""" if truncate: diff --git a/src/haiku/rag/cli.py b/src/haiku/rag/cli.py index 03f653a6..426af784 100644 --- a/src/haiku/rag/cli.py +++ b/src/haiku/rag/cli.py @@ -128,6 +128,12 @@ def ask( event_loop.run_until_complete(app.ask(question=question)) +@cli.command("settings", help="Display current configuration settings") +def settings(): + app = HaikuRAGApp(db_path=Path()) # Don't need actual DB for settings + app.show_settings() + + @cli.command( "rebuild", help="Rebuild the database by deleting all chunks and re-indexing all documents",