Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

passing save-text-file-flag throughout the project

matthew-heartful0ffdadc91308
diff --git a/screenpipe-server/src/bin/screenpipe-video.rs b/screenpipe-server/src/bin/screenpipe-video.rs
index 354fc57d3..40826a021 100644
--- a/screenpipe-server/src/bin/screenpipe-video.rs
+++ b/screenpipe-server/src/bin/screenpipe-video.rs
@@ -10,6 +10,15 @@ use std::io::{BufWriter, Write};
use std::sync::{Arc, Mutex};
use std::thread;
use std::time::Duration;
+use clap::Parser;
+
+#[derive(Parser)]
+#[command(author, version, about, long_about = None)]
+struct Cli {
+ /// Save text files
+ #[arg(long, default_value_t = false)]
+ save_text_files: bool,
+}
fn write_json_frame(writer: &mut BufWriter<File>, frame_data: &Value) -> std::io::Result<()> {
serde_json::to_writer(writer.by_ref(), frame_data)?;
@@ -23,6 +32,9 @@ fn write_json_frame(writer: &mut BufWriter<File>, frame_data: &Value) -> std::io
async fn main() {
env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
+ let cli = Cli::parse();
+ let save_text_files = cli.save_text_files;
+
let time = Utc::now();
let formatted_time = time.format("%Y-%m-%d_%H-%M-%S").to_string();
let output_path = "data";
@@ -39,7 +51,7 @@ async fn main() {
}
};
- let video_capture = VideoCapture::new(output_path, fps, new_chunk_callback);
+ let video_capture = VideoCapture::new(output_path, fps, new_chunk_callback, save_text_files);
let (_tx, rx): (Sender<()>, Receiver<()>) = channel(32);
let rx = Arc::new(Mutex::new(rx));
let rx_thread = rx.clone();
@@ -90,4 +102,4 @@ async fn main() {
video_capture.stop().await;
println!("Video capture completed. Output saved to: {}", output_path);
println!("JSON data saved to: {}", json_output_path);
-}
+}
\ No newline at end of file