File System Tools¶
Tools for reading, writing, and navigating files.
read_file¶
Read the contents of a file.
Usage:
Or with @ syntax:
Parameters:
| Parameter | Type | Description |
|---|---|---|
path |
string | File path to read |
Confirmation: Not required
write_file¶
Create or overwrite a file.
Usage:
Parameters:
| Parameter | Type | Description |
|---|---|---|
path |
string | File path |
content |
string | File content |
Confirmation: Required (shows diff for existing files)
edit¶
Smart code editing with diff-based modifications.
Usage:
Parameters:
| Parameter | Type | Description |
|---|---|---|
path |
string | File path |
old_content |
string | Content to replace |
new_content |
string | Replacement content |
Confirmation: Required (shows diff)
Features:
- Context-aware replacements
- Preserves formatting
- Shows clear diffs
list_directory¶
List contents of a directory.
Usage:
Parameters:
| Parameter | Type | Description |
|---|---|---|
path |
string | Directory path |
Confirmation: Not required
glob¶
Find files matching a pattern.
Usage:
Parameters:
| Parameter | Type | Description |
|---|---|---|
pattern |
string | Glob pattern |
path |
string | Starting directory (optional) |
Patterns:
| Pattern | Matches |
|---|---|
*.ts |
TypeScript files in current dir |
**/*.ts |
TypeScript files recursively |
src/**/*.{ts,tsx} |
TS/TSX files in src |
!**/node_modules/** |
Exclude node_modules |
Confirmation: Not required
grep¶
Search file contents with regex support.
Usage:
Parameters:
| Parameter | Type | Description |
|---|---|---|
pattern |
string | Search pattern (regex) |
path |
string | Directory to search |
include |
string | File pattern to include |
Examples:
> Search for "import React" in all tsx files
> Find functions that start with "handle"
> Look for console.log statements
Confirmation: Not required
Common Patterns¶
Exploring Code¶
Reading Files¶
Searching¶
Modifying Files¶
File References with @¶
The @ symbol provides quick file context:
> Explain @src/components/Button.tsx
> What does @package.json say about the version?
> Refactor @utils/helpers.js
Multiple files:
Folders:
Respecting Ignore Files¶
By default, file tools respect:
.gitignore.dialignore
Configure in settings: