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

feat: add --encrypt-store CLI flag for store.bin encryption

Louis Beaumont85ecd7935aa0
diff --git a/crates/screenpipe-engine/src/cli/mod.rs b/crates/screenpipe-engine/src/cli/mod.rs
index c73022e73..9a1edaa36 100644
--- a/crates/screenpipe-engine/src/cli/mod.rs
+++ b/crates/screenpipe-engine/src/cli/mod.rs
@@ -349,6 +349,10 @@ pub struct RecordArgs {
/// Localhost requests are always allowed.
#[arg(long, default_value_t = false)]
pub api_auth: bool,
+
+ /// Encrypt store.bin at rest using an OS keychain-stored key.
+ #[arg(long, default_value_t = false)]
+ pub encrypt_store: bool,
}
impl RecordArgs {
@@ -498,6 +502,15 @@ impl RecordArgs {
json["token"].as_str().map(|s| s.to_string())
});
}
+
+ // Sync the .encrypt-store flag file
+ let flag_path = config.data_dir.join(".encrypt-store");
+ if self.encrypt_store && !flag_path.exists() {
+ let _ = std::fs::write(&flag_path, b"");
+ } else if !self.encrypt_store && flag_path.exists() {
+ let _ = std::fs::remove_file(&flag_path);
+ }
+
config
}
}