The files API runs inside the gateway container and provides the bridge between the UI’s file browser and the agent’s git worktree on the gateway.Documentation Index
Fetch the complete documentation index at: https://docs.yourhq.ai/llms.txt
Use this file to discover all available pages before exploring further.
Capabilities
| Operation | Description |
|---|---|
| List | Browse files in an agent’s branch |
| Read | Fetch file contents |
| Create | Add new files to the worktree |
| Edit | Update existing files |
| Delete | Remove files |
| Commit | Every write is immediately committed to git |
Authentication
The API is gated byGATEWAY_AUTH_TOKEN — a pre-shared secret between the UI and gateway. Generate it with openssl rand -hex 32.
Safety
- Path traversal is rejected via
safe_join()— requests can’t escape the agent’s worktree. - After a successful write, the UI automatically enqueues an
updatecommand so OpenClaw reloads the agent with the changed files.