> ## Documentation Index
> Fetch the complete documentation index at: https://rapidreview.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Local folder access

> Let one web chat session read — and optionally write — a folder on your computer, with permissions you control from the CLI.

The web app can't see your computer. The CLI bridges **one** chat session to **one** local folder; each terminal window can bridge a different folder to a different session.

<Tabs>
  <Tab title="From the terminal chat">
    <Steps>
      <Step title="Start Nisa in the folder">
        ```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
        cd ~/papers/my-project
        nisa
        ```

        Local access must be on (`/permissions on` if you turned it off).
      </Step>

      <Step title="Get a token from the web session">
        In the web chat type `/connect`. Copy the `brg_…` token — one-shot, valid five minutes.
      </Step>

      <Step title="Paste it">
        ```text theme={"theme":{"light":"github-light","dark":"dark-plus"}}
        /connect <token>
        /connect <token> --allow-writes --workspace ~/project      # with options
        /connect <token> --allow-exec
        /connect <token> --no-terminal
        ```

        <Check>`/status` shows the bridge. `/disconnect` ends it.</Check>
      </Step>
    </Steps>
  </Tab>

  <Tab title="Headless">
    ```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
    nisa bridge --claim <token> --workspace ~/papers/my-project [--allow-writes] [--allow-exec] [--idle-timeout 600]
    ```

    Or attach to a known session with `--session-id <id>` instead of `--claim`. Approvals are `auto` or `deny` — there's no prompt without a TTY.
  </Tab>
</Tabs>

## Permissions

The CLI decides; the web app can only ask. Defaults: read the folder, no writes, no agent shell commands; your own `!cmd` is on. Settings apply to one connected session at a time.

| Goal                               | Command                                                                       |
| ---------------------------------- | ----------------------------------------------------------------------------- |
| Show current settings              | `/permissions` (alias `/approvals`) · `/status`                               |
| Turn local access off / on         | `/permissions off` · `/permissions on`                                        |
| Read files only (default)          | `/permissions read-only`                                                      |
| Let the agent create or edit files | `/permissions workspace-write` (or `allow-writes`; revoke with `deny-writes`) |
| Let the agent run commands         | `/permissions shell-exec` (or `allow-exec`; revoke with `deny-exec`)          |
| Your own `!cmd` on (default) / off | `/permissions terminal on` · `/permissions terminal off`                      |
| Change the folder                  | `/permissions workspace <dir>`                                                |

The agent's tools over the bridge: `fs.read_file`, `fs.list_dir`, `fs.glob`, `fs.grep`; with writes, `fs.write_file`, `fs.edit_file` (an edit needs a prior read of the file, or an `expected_hash`; concurrent writes to one path are refused); with exec, `shell.exec` (credential-shaped env vars scrubbed, cwd clamped — not a sandbox). Your own `!cmd` runs locally and is never an agent tool.
