opencode-fs-plugin 1.6.2 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/filesystem/SKILL.md +19 -0
package/package.json
CHANGED
|
@@ -113,6 +113,25 @@ host drops unknown fields, so a name typo runs with defaults.
|
|
|
113
113
|
- `fs.mktemp` needs a template ending in at least three `X`; use `suffix` for an
|
|
114
114
|
extension.
|
|
115
115
|
|
|
116
|
+
### Shell patterns and their fs equivalents
|
|
117
|
+
|
|
118
|
+
| Shell pattern | Use |
|
|
119
|
+
|---|---|
|
|
120
|
+
| `sed -n '1,80p' f` | `fs.head({ paths: [f], lines: 80 })` |
|
|
121
|
+
| `sed -n '20,40p' f` | `fs.pipe({ stages: [{ tool: "cat", args: { paths: [f] } }, { tool: "head", args: { lines: 40 } }, { tool: "tail", args: { lines: 21 } }] })` |
|
|
122
|
+
| `sed 's/a/b/'` / `sed -i` | `fs.sed({ script, paths, inPlace })` |
|
|
123
|
+
| `head -n N f` / `tail -n N f` | `fs.head` / `fs.tail` |
|
|
124
|
+
| `wc -l f` | `fs.wc({ paths: [f], lines: true })` |
|
|
125
|
+
| `sha256sum f` | `fs.hash({ files: [f] })` |
|
|
126
|
+
| `find ... -exec rm -rf {} +` | `fs.find(...)`, then `fs.rm({ paths, recursive: true })` or `fs.trash` |
|
|
127
|
+
| `cat > f <<EOF` | built-in `write` or `fs.tee({ paths: [f], content })` |
|
|
128
|
+
| `rg pattern path` | `fs.grep({ pattern, paths })` or the built-in `grep` |
|
|
129
|
+
| `ls -l f` | `fs.ls({ paths: [f], long: true })` |
|
|
130
|
+
|
|
131
|
+
`sed -n` applied to another command's stdout has no fs equivalent; keep that in
|
|
132
|
+
the command pipeline. `fs.find` has no `-exec` by design; list the paths, then
|
|
133
|
+
delete or trash them explicitly.
|
|
134
|
+
|
|
116
135
|
## Batch independent calls
|
|
117
136
|
|
|
118
137
|
`execute` is a JS runtime. Do not `await` independent fs calls one at a time.
|