A safe local shell environment in your browser
Wesh is a local shell environment that runs inside your browser. Commands such as grep, sed and jq run on your device to search, organize and edit files. With the app and working files prepared on your device, these file operations also work offline.
With Shell enabled, you can ask AI to find unfinished tasks in project notes, compare files or process a table through tool calls. Results become input to the selected chat model. Prepare an in-browser model to let AI handle these file tasks offline; a server model receives the results at its configured endpoint.
The shell works with the Chat’s workspace and folders made available to it. Choose mounts and write access in advance; commands use that scope 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.
Tool settings are saved by default, including this Chat’s Shell switch. Tool config persistence controls saving Global, Chat Group, and Chat tool settings; it does not turn tools on. If it is off, new Chat changes last only until this page is reloaded or closed, while saved settings remain active.
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.
The separate live conversation workspace offers opt-in Wesh with one selected folder and approval for each command batch. It does not inherit Chat folders or the Naidan file mount described here.
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