summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cli.rs3
-rw-r--r--src/main.rs6
2 files changed, 9 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 2de6113..18bc442 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -30,6 +30,9 @@ pub struct Cli {
/// Start a RAG
#[clap(long)]
pub rag: Option<String>,
+ /// Rebuild the RAG to sync document changes
+ #[clap(long)]
+ pub rebuild_rag: bool,
/// Serve the LLM API and WebAPP
#[clap(long, value_name = "ADDRESS")]
pub serve: Option<Option<String>>,
diff --git a/src/main.rs b/src/main.rs
index 11fea86..056133c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -152,6 +152,12 @@ async fn run(config: GlobalConfig, cli: Cli, text: Option<String>) -> Result<()>
return Ok(());
}
let is_repl = config.read().working_mode.is_repl();
+ if cli.rebuild_rag {
+ Config::rebuild_rag(&config, abort_signal.clone()).await?;
+ if is_repl {
+ return Ok(());
+ }
+ }
if cli.execute && !is_repl {
if cfg!(target_os = "macos") && !stdin().is_terminal() {
bail!("Unable to read the pipe for shell execution on MacOS")