Skip to main content

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.

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.

Capabilities

OperationDescription
ListBrowse files in an agent’s branch
ReadFetch file contents
CreateAdd new files to the worktree
EditUpdate existing files
DeleteRemove files
CommitEvery write is immediately committed to git

Authentication

The API is gated by GATEWAY_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 update command so OpenClaw reloads the agent with the changed files.
Do not expose the files API directly to the public internet. It should only be reachable by the UI server process or over a private network like Tailscale.