$worker
shell
v0.3.5Unix shell + filesystem worker — exec with allowlist/denylist/timeout/output caps and background jobs; fs::ls|stat|mkdir|rm|chmod|mv|grep|sed|read|write with host jail, denylist, size caps, and sandbox-target forwarding
- macOS: arm64 · x64
- Linux: arm64 · armv7 · x64
skill doc
skills/sed.md
Find-and-replace across files
When to use
- Multi-file rewrite where
shell::fs::grepis the read-side preview. - Single-file regex replace that would otherwise reach for
sed -i. - Templating step over a generated tree.
Notes
- Supply either
files: ["/abs/a", …]for an explicit list orpath(a directory) for a recursive walk; orpathto a single file for a one-off rewrite. patternis a regex whenregex: true(default).replacementsupports$1,$2, … capture-group backreferences. Setregex: falsefor a literal pattern.first_only: truerewrites only the first match per file; the default rewrites every match.- There is no line-anchor flag; encode it inside the pattern (
(?m)^…). - Per-file results carry
success: falseplus anerrorstring for files that failed to rewrite (permission denied, regex compilation error).total_replacementssums across files. - Approval policy mirrors
shell::fs::write: set per-run by the orchestrator'sapproval_requiredarray, not hardcoded into the function. - When unsure about the regex, run
shell::fs::grepwith the same pattern first.