Local Files
List, stat, read (UTF-8 or base64, capped with truncated), search by name glob or plain-text content, and staged writes that never overwrite unless a node asks, realpath checks, no FIFOs/devices/hard links, agent writes opt-in, deletes node only
Stable v0.1.0 Node.js 7 actions
About
A Graphrt plugin for files in directories you allow. Workflows and agents can list, stat, read and search files there, and write new ones. Nothing outside LOCAL_FILES_ALLOWED_DIRS is reachable, agents are read-only unless you opt in, and even then they can only create new files.
What it can do
- list_allowed_directories: the allowed roots as real paths, and whether each exists.
- list_directory: name, type, size and modified time, sorted, max_depth (1–10) recurses, limit (default 500, at most 5000) caps the entries and sets truncated. Hidden names only with include_hidden.
- stat: type (file, directory, symlink, fifo, socket, device), size, modified/created/accessed times, permission bits and hard-link count, without opening the file. Regular files with more than one hard link are refused (their metadata could belong to a file outside the allowlist).
- read_file: UTF-8 text or base64, from offset, at most max_bytes (default 256 KiB, never more than LOCAL_FILES_MAX_READ_BYTES). A capped read returns truncated: true and next_offset, a UTF-8 slice never ends in the middle of a character. Bytes that are not valid UTF-8 are refused with a hint to use base64.
- search_files: by file-name glob (*, ?) and/or a plain-text substring per line (no regular expressions, so no ReDoS), case-insensitive by default, bounded by max_depth, max_results, max_matches_per_file (default 10, files_with_more_matches counts files that had more) and LOCAL_FILES_MAX_SEARCH_FILES (every entry visited counts, directories included, see entries_scanned). Name globs use a linear two-pointer matcher, so hostile patterns cannot stall it. Binary, oversized and hard-linked files are skipped and counted in skipped_files.
- write_file: UTF-8 or base64 content to a new file, staged and published atomically, create_parents makes missing directories inside the allowlist. overwrite: true (workflow nodes only) replaces an existing regular file and keeps its permission bits.
- delete_path (workflow nodes only): one file, symlink (the link itself) or empty directory.
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- List allowed directories
local-files.list_allowed_directories - Stat a path
local-files.stat - Read a file
local-files.read_file - List a directory
local-files.list_directory - Search files
local-files.search_files - Write a file
local-files.write_file - Delete a file or empty directory
local-files.delete_path
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
LOCAL_FILES_ALLOWED_DIRS(required)Comma-separated directories (absolute or ~/...), subdirectories included. Relative paths in calls start at the first one. -
LOCAL_FILES_TOOL_ALLOW_WRITES(off)1 lets agents call write_file to create new files. Workflow nodes can always write. -
LOCAL_FILES_MAX_READ_BYTES1 MiBMost bytes one read_file returns (1024 to 64 MiB), also the largest file search_files reads -
LOCAL_FILES_MAX_WRITE_BYTES10 MiBLargest write_file content (1024 to 1 GiB) -
LOCAL_FILES_MAX_SEARCH_FILES10000Most entries (files, directories, symlinks) one search_files call visits (10 to 200000)
How to use it
In Graphrt Desktop
- Open Plugins and search for Local Files.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
terminal
$ graphrt plugin install local-files workflow.yaml
- { id: save, type: local-files.write_file, path: reports/today.md, content: "{{#llm.text#}}", create_parents: true }
- { id: read, type: local-files.read_file, path: reports/today.md }