# Sync files and the REST API

For agents that keep memory as local markdown files (for example OpenClaw or Hermes).

hugy-sync.py: https://hugy.ai/app/hugy-sync.py

    export HUGY_TOKEN=<YOUR_TOKEN>
    python3 hugy-sync.py push DIR   # upload every top-level *.md in DIR
    python3 hugy-sync.py pull DIR   # download every Hugy file into DIR
    python3 hugy-sync.py list

Options: `--dry-run`; `--api URL` (default https://hugy.ai/app/api). Pull never deletes local files and skips a local file newer than the Hugy copy unless `--force`.

REST API, same bearer token (`Authorization: Bearer <YOUR_TOKEN>`), base https://hugy.ai/app/api:
- `GET /files`: list files.
- `GET /files/{name}`: returns `{"content": ...}`.
- `PUT /files/{name}` with body `{"content": "..."}`: create or replace.

Push replaces Hugy copies with your local ones, so pull first if other agents may have written.

Full docs index: https://hugy.ai/agents/index.md
