Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
fix(cli): require --detach in agent workflow docs and harden inputs
Richie McIlroye912a3d075bb
diff --git a/apps/cli/README.md b/apps/cli/README.mdindex 0e6f03b46..527ff00e1 100644--- a/apps/cli/README.md+++ b/apps/cli/README.md@@ -58,7 +58,7 @@ is taken from `CAP_SERVER_URL`, else Cap Desktop's configured server, else `http```shcap doctor --json # verify permissions & capture readiness (exits 0; read `ok`/`captureReady`)cap targets --json # discover screens/windows/cameras/mics (ids feed the next steps)-cap record start --screen <id> --json # start in the background -> {"type":"started","recordingId","pid","path"}+cap record start --screen <id> --json --detach # start in the background -> {"type":"started","recordingId","pid","path"}# ... the agent performs whatever it needs to capture ...cap record stop --id <recordingId> --json # finalize -> {"type":"stopped","path","recordingMetaExists":true}cap project validate <path.cap> --json # confirm the recording is complete before exportingdiff --git a/apps/cli/src/credentials.rs b/apps/cli/src/credentials.rsindex d2ce1b342..c0005954a 100644--- a/apps/cli/src/credentials.rs+++ b/apps/cli/src/credentials.rs@@ -61,6 +61,7 @@ fn store_server(store: &Value) -> Option<String> {.get("general_settings")?.get("serverUrl")?.as_str()+ .filter(|value| !value.is_empty()).map(str::to_string)}diff --git a/apps/cli/src/main.rs b/apps/cli/src/main.rsindex 6a44257ce..6a501fe7c 100644--- a/apps/cli/src/main.rs+++ b/apps/cli/src/main.rs@@ -47,7 +47,7 @@ ENVIRONMENTTYPICAL AGENT WORKFLOWcap doctor --json # verify permissions & capture readinesscap targets --json # discover screens/windows/cameras/mics- cap record start --screen <id> --json # start in background -> {recordingId, pid, path}+ cap record start --screen <id> --json --detach # start in background -> {recordingId, pid, path}cap record stop --id <recordingId> --json # finalize the .cap recordingcap project validate <path.cap> --json # confirm the recording is completecap export <path.cap> --output out.mp4 --jsondiff --git a/apps/cli/src/record.rs b/apps/cli/src/record.rsindex 5741b99fb..a410e41b0 100644--- a/apps/cli/src/record.rs+++ b/apps/cli/src/record.rs@@ -55,11 +55,11 @@ pub struct RecordParams {impl RecordParams {fn validate(&self) -> Result<(), String> {- if self- .duration- .is_some_and(|duration| !duration.is_finite() || duration <= 0.0)- {- return Err("Duration must be greater than 0".to_string());+ if self.duration.is_some_and(|duration| {+ // `> u64::MAX` would panic in `Duration::from_secs_f64` (used by `wait_for_stop`).+ !duration.is_finite() || duration <= 0.0 || duration > u64::MAX as f64+ }) {+ return Err("Duration must be a positive, finite number of seconds".to_string());}if self.fps == Some(0) {return Err("--fps must be greater than 0".to_string());