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

fix: use correct opencode CLI command 'opencode run'

Louis Beaumontf46833117c3d
diff --git a/screenpipe-app-tauri/src-tauri/src/obsidian_sync.rs b/screenpipe-app-tauri/src-tauri/src/obsidian_sync.rs
index b5936db73..1aaedb25b 100644
--- a/screenpipe-app-tauri/src-tauri/src/obsidian_sync.rs
+++ b/screenpipe-app-tauri/src-tauri/src/obsidian_sync.rs
@@ -344,10 +344,11 @@ async fn run_opencode_sync(app: &AppHandle, prompt: &str) -> Result<(), String>
let shell = app.shell();
let cmd_result = shell.sidecar("opencode");
+ // Use "opencode run <message>" command
let (mut rx, _child) = match cmd_result {
Ok(cmd) => {
- // Use sidecar with prompt as argument
- cmd.args(&["-p", prompt, "--no-input"])
+ // Use sidecar with "run" subcommand
+ cmd.args(&["run", prompt])
.spawn()
.map_err(|e| format!("Failed to spawn opencode: {}", e))?
}
@@ -355,7 +356,7 @@ async fn run_opencode_sync(app: &AppHandle, prompt: &str) -> Result<(), String>
// Try PATH
shell
.command("opencode")
- .args(&["-p", prompt, "--no-input"])
+ .args(&["run", prompt])
.spawn()
.map_err(|e| format!("Failed to spawn opencode from PATH: {}", e))?
}