Let AI work with files using a browser shell
Ask AI to find unfinished tasks in project notes, compare files or process a table. With Shell enabled, the AI can use familiar commands through a tool call. The result becomes input to the selected chat model: an in-browser model processes it on your device, while a server model receives it at the configured endpoint.
The commands run in the browser’s shell, with access to the workspace and folders made available to the Chat. You choose folder mounts and write access in advance; Shell uses them for each command without asking again.
Open Naidan and choose a chat with a model that supports tool calls.
If you still need to set up a model, see browser model setup or the local engine connection guide. For a model to try with tool calls, choose Qwen3.5 9B (Q4_K_M GGUF).
Commands and results5 calls
This sample starts with a clean local Git repository mounted at /home/user/project with write access. notes.md is tracked, and task-summary.md does not exist yet.
Check the initial Git state
git -C /home/user/project status --shortExit Code: 0
Find TODOs and their line numbers
grep -n 'TODO' /home/user/project/notes.mdExit Code: 0 STDOUT: 3:TODO: Confirm the venue 7:TODO: Send invitations
Read the surrounding notes
sed -n '1,8p' /home/user/project/notes.mdExit Code: 0 STDOUT: # Project notes TODO: Confirm the venue Next review: Friday. TODO: Send invitations
Create the summary with a here-document
cat <<EOF > /home/user/project/task-summary.md
# Task summary
- Confirm the venue
- Send invitations
EOF
Exit Code: 0
Read the saved file and check Git again
cat /home/user/project/task-summary.md
git -C /home/user/project status --shortExit Code: 0 STDOUT: # Task summary - Confirm the venue - Send invitations ?? task-summary.md
Enable Shell in this Chat
1. Open the Chat tools
Below the message box, select the gear-shaped Tools button beside the attachment button. The Options/Tools sheet opens from the bottom of the Chat.
2. Turn on Shell
In the tool settings, find Shell (Shell in browser) and turn its switch on. If you already attached a folder and Shell is on, leave it on. Shell settings appears beneath the tools. The ordinary chat switch leaves the Naidan file mount off by default.
For the setup and access scope, see how to read chats and saved files through Wesh sysfs.
To work with a folder on your device, open the attachment menu beside Tools and choose Folder (copy) or Folder (link). See how to choose files and access. Then ask an AI model that supports tool calls to list files at the folder’s displayed mount path, or give it another specific file task. Shell results return to the Chat, as shown above.
Familiar commands, a browser-backed filesystem
The shell is called Wesh internally. Commands such as ls, cat, grep, sed, jq and Git operate on its mounted filesystems. An OS executable is not automatically a Wesh command: each supported command is implemented for this environment.
Check the folders Shell can use
Shell uses the Chat’s workspace and folders made available to it. Read-only access is enough for searches. Creating a file, as in the example, requires write access to its folder.
Commands available inside the browser
These are representative commands implemented in Wesh. They work on files visible to the Chat; changing files requires write access to their mounted folder.
- Find and organize files
lstreefindcatcpmvmkdirInspect a folder, find a file or read its contents. Copy or rename files and create folders in writable locations.
- Search and process text
greprgsedawksortuniqwcFind matching lines, replace text, extract fields, sort lines, remove adjacent duplicates or count the results. Combine commands with pipes for a longer task.
- Extract structured data
jqcutQuery and transform JSON with jq, or select columns from delimiter-separated text with cut.
- Pack and unpack files
zipunzipgzipgunzipCreate or extract ZIP archives and compress or decompress gzip files inside the browser.
- Compare and check files
diffpatchsha256sumCompare file versions, apply a text patch or compute and check SHA-256 checksums.
- Review and save changes with Git
git statusgit diffgit loggit addgit commitInspect a mounted repository and record changes as commits. Repository transfers use local paths visible to Wesh; Internet repository connections are disabled.
See the full command list and command-specific options: help · help grep · grep --help