fs
Execute file system actions: read, write, edit, delete, copy, move, search, grep, diff, hash, and manage directories. Unsandboxed local access.
Instructions
Full shell filesystem access (UNSANDBOXED, 50MB read limit). Use for all file operations. Doesn't encounter race conditions with file watchers. grep contains all the functionality of bash + powershell filesystem search. Auto-fixes code fences and smart quotes on write. Actions: read, write, edit, delete, copy, move, mkdir, rmdir, list, tree, search, grep, stat, diff, hash, touch, head, tail, duplicates. edit: [{old_text, new_text}]. grep: regex search in directories. diff: compare files/strings. hash: SHA256/MD5 checksums. duplicates: find duplicate files by hash.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Write mode (default: overwrite) | |
| path | No | ||
| edits | No | For edit: [{old_text, new_text}, ...] | |
| limit | No | Lines to read (0=all) or lines to replace in replace_lines mode | |
| lines | No | For head/tail: number of lines (default: 10) | |
| regex | No | For grep: treat pattern as regex instead of substring (default: false) | |
| action | Yes | ||
| offset | No | Starting line (1-based) for read chunk or write insert/replace | |
| path_a | No | For diff: first file path | |
| path_b | No | For diff: second file path | |
| confirm | No | For rmdir: confirm deleting a directory that contains more than 50 items. | |
| content | No | ||
| dry_run | No | For edit: preview diff without writing | |
| pattern | No | ||
| min_size | No | For duplicates: min file size in bytes (default: 1) | |
| algorithm | No | For duplicates: hash algorithm (default: sha256) | |
| content_a | No | For diff: first content string | |
| content_b | No | For diff: second content string | |
| max_depth | No | For grep: max directory depth | |
| recursive | No | For rmdir: recurse into non-empty directories. | |
| algorithms | No | For hash: list of algorithms (md5, sha1, sha256, sha512) | |
| destination | No | ||
| ignore_case | No | For grep: case-insensitive search (default: false) | |
| max_results | No | For grep: max matches | |
| file_pattern | No | For grep: file glob (*.py) | |
| context_lines | No | For grep/diff: lines of context (default: 0/3) | |
| output_format | No | For diff: output format (default: unified) | |
| create_parents | No | For touch: create parent dirs (default: true) | |
| max_line_length | No | For grep: max chars per line in output (default: 500) | |
| include_metadata | No | For list: include size, type, and mtime for each entry. | |
| preserve_indentation | No | For edit: apply old_text's leading indentation to new_text (default: true). |