Naidan
Guides

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.

You

Check Git and the TODOs in the project notes, then save a task summary in task-summary.md.

Check the initial Git state

Command
git -C /home/user/project status --short
Result
Exit Code: 0

Find TODOs and their line numbers

Command
grep -n 'TODO' /home/user/project/notes.md
Result
Exit Code: 0

STDOUT:
3:TODO: Confirm the venue
7:TODO: Send invitations

Read the surrounding notes

Command
sed -n '1,8p' /home/user/project/notes.md
Result
Exit Code: 0

STDOUT:
# Project notes

TODO: Confirm the venue

Next review: Friday.

TODO: Send invitations


Create the summary with a here-document

Command
cat <<EOF > /home/user/project/task-summary.md
# Task summary

- Confirm the venue
- Send invitations
EOF
Result
Exit Code: 0

Read the saved file and check Git again

Command
cat /home/user/project/task-summary.md
git -C /home/user/project status --short
Result
Exit Code: 0

STDOUT:
# Task summary

- Confirm the venue
- Send invitations
?? task-summary.md

Assistant

Created task-summary.md with these two tasks. Git reports the summary as a new, untracked file.

  • Confirm the venue.
  • Send invitations.
A sample task in a writable local project: the AI checks Git, searches with grep, reads with sed, creates task-summary.md with cat <<EOF and checks the saved file and Git state. The AI calls shell_execute repeatedly as the task progresses. Completed call headers stay in the conversation; the current call shows its script and result. The scene replays together, and the full transcript remains available to read. No model, command or file operation runs in this demonstration.

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.

The Chat’s Tools button opens its tool settings.

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.

The Shell switch changes from OFF to ON in this Chat.

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 fileslstreefindcatcpmvmkdir

    Inspect a folder, find a file or read its contents. Copy or rename files and create folders in writable locations.

  • Search and process textgreprgsedawksortuniqwc

    Find 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 datajqcut

    Query and transform JSON with jq, or select columns from delimiter-separated text with cut.

  • Pack and unpack fileszipunzipgzipgunzip

    Create or extract ZIP archives and compress or decompress gzip files inside the browser.

  • Compare and check filesdiffpatchsha256sum

    Compare file versions, apply a text patch or compute and check SHA-256 checksums.

  • Review and save changes with Gitgit statusgit diffgit loggit addgit commit

    Inspect 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