# localfiles

> Local-first documents, spreadsheets and presentations that agents write and people read.
> Files live in the browser; sharing, other devices, self-hosted storage and agent access are optional.

App: https://localfiles.eu/ . Source and issues:
https://codeberg.org/localfiles/localfiles (AGPL-3.0-only).

## Understand the file first

- [Documentation index](https://codeberg.org/localfiles/localfiles/src/branch/main/docs/index.md): role-based reading paths.
- [EXPERIENCE](https://codeberg.org/localfiles/localfiles/src/branch/main/docs/EXPERIENCE.md): agents create, humans read.
- [LIFECYCLE](https://codeberg.org/localfiles/localfiles/src/branch/main/docs/LIFECYCLE.md): identity, owner, account clones.
- [Sharing lifecycle](https://codeberg.org/localfiles/localfiles/src/branch/main/docs/LIFECYCLE-SHARING.md): grants and copies.
- [FORMAT](https://codeberg.org/localfiles/localfiles/src/branch/main/docs/FORMAT.md): Yjs container and external assets.
- [Development](https://codeberg.org/localfiles/localfiles/src/branch/main/docs/DEVELOPMENT.md): stack, workflow and checks.

These foundations govern every editor, service and agent tool. Copies of the same identity merge;
Make a copy forks into a new identity. Anonymous files never share or sync until claimed.

## Connect an agent

- Read [the connection skill](https://localfiles.eu/agent/SKILL.md), obtain user consent, then follow it.
- The skill installs `localfiles-agent` from https://localfiles.eu/agent/bin/ (Linux, macOS, Windows; no dependencies).
  Register as a stdio MCP server (Claude Code, Codex, any MCP client) or use the CLI when MCP is unavailable.
- The user opens a pairing link and clicks Connect in the profile holding their files; one tab per bridge.
  Disconnect on the Agent page or close the tab to revoke. No hosted MCP or document API exists.
- Verify the target with `files_list` before editing; read back writes. Ask before destructive actions.
- People read: every file opens in read mode and content tools write in any mode. `ui_command mode.edit` enters
  edit for tools that act on the visible view; they answer `needs-edit` otherwise.
- Tools and instructions come from the tab, not the binary: `localfiles://instructions` or `localfiles-agent tools`.
- `localfiles://format` supplies lifecycle, container, type definitions and body schemas before raw Yjs edits.
- WebMCP uses the same tools when `document.modelContext` (older: `navigator.modelContext`) is available.
  Browser support may require a flag and restart. Tool families cover every UI capability: files, all editors,
  comments, imports/exports, backups, settings, sharing and commands.
- Tool results may reach the agent's model provider. Local transport is not a promise of private model inference.
- [User agent guide](https://localfiles.eu/#/docs/agent) · [API catalog](https://localfiles.eu/.well-known/api-catalog).

## Storage, sharing and privacy

- Editing, imports, exports and backups work without an account. Offline use requires the complete shell cached first.
- Optional email login uses AUTH for device-bound credentials, signaling and discovery; these services are rate-limited.
- Content syncs through mutually authorized, sealed PeerShare WebRTC sessions. AUTH and TURN have no content keys.
- PSS is a self-hosted always-on clone with encrypted versions, not a hosted storage subscription.
  Operators can decrypt member files and storage keys; pairing is a trust decision.
- Image: [localfiles/pss](https://hub.docker.com/r/localfiles/pss), linux/amd64 and linux/arm64.
  Pin an immutable released MAJOR.MINOR tag, or use latest. Default standalone allowance: five users.
- [PSS operator skill](https://localfiles.eu/pss/SKILL.md): Docker install, Admin configuration, DNS coverage and backups.
- [User Help](https://localfiles.eu/#/docs): editing, sharing, account spaces, exports and recovery.
- No telemetry, cloud drive sync or third-party scripts.

Contact: hello@localfiles.eu
