Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save rndmcnlly/1e1eec80efb6feb0af75508f5196238c to your computer and use it in GitHub Desktop.

Select an option

Save rndmcnlly/1e1eec80efb6feb0af75508f5196238c to your computer and use it in GitHub Desktop.

USER

Letโ€™s test this new fs tool

ASSISTANT

Sure! Let me start by asking you to share a local folder so I can browse it.

Tool Executed
A folder has been shared! Let me take a look at what's inside:
Tool Executed
Here's what's in the shared **picker-agent** folder:
Name Type Size
๐Ÿ“ example_folder/ Directory โ€”
๐Ÿ“„ filesystem_tools.py File ~20.6 KB
๐Ÿ“„ AGENTS.md File ~4.5 KB

I can now:

  • List deeper into example_folder/
  • Read the contents of any file
  • Search for text patterns across all files

What would you like to explore? ๐Ÿ”

USER

agents?

ASSISTANT

Let me read the AGENTS.md file for you!

Tool Executed
Here's a summary of the **AGENTS.md** file:

๐Ÿ“ picker-agent

A read-only Open WebUI toolkit that gives LLMs access to a user's local filesystem via the browser's File System Access API.

How It Works

  • A single Python file (filesystem_tools.py) pasted into Open WebUI's Workspace > Tools
  • Python builds JavaScript โ†’ sends it to the browser for execution โ†’ parses the JSON result back
  • Everything lives in the browser tab's memory (no server-side storage)

๐Ÿ”ง Four Tools

Tool Purpose
open_local_folder Injects a modal for the user to pick a folder (must be called first)
list_files Recursive directory listing (max 500 entries)
read_file Reads file slices with pagination support (default 20KB chunks)
search_files Regex grep across text files (max 100 matches)

โš ๏ธ Key Details

  • Chromium-only (Chrome/Edge 86+) โ€” not supported in Firefox or Safari
  • Folder handles are stored per chat ID and lost on tab refresh
  • All JS uses try/catch to always return a JSON response (avoids hanging)
  • showDirectoryPicker() requires a user gesture (click), hence the modal overlay

๐Ÿ”ฎ Future Work

  • Persist handles via IndexedDB
  • Add a file_info metadata tool
  • Auto-instruct models about the tool lifecycle

Want me to dive into the actual filesystem_tools.py source code or explore the example_folder?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment