Clint Server API

Authentication Required
All requests must include the header: Authorization: Bearer YOUR_TOKEN

Sync State (Upload)

POST /api/sync

Upload a ZIP file containing the full .clint directory structure. Use this for full backups.

Query Params: owner, repo
curl -X POST "{BASE_URL}/api/sync?owner=myorg&repo=project-x" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/zip" \
--data-binary @clint_state.zip

Download State

GET /api/download

Download the latest .clint state as a ZIP file.

Query Params: owner, repo
curl "{BASE_URL}/api/download?owner=myorg&repo=project-x" \
-H "Authorization: Bearer {TOKEN}" \
-o clint_restore.zip

File Operations (Upload/Download)

Upload File

POST /api/bullet/file

Upload a specific file (e.g., instructions.md, overview.md) to a bullet directory.

Query Params: owner, repo, bullet, filename
curl -X POST "{BASE_URL}/api/bullet/file?owner=myorg&repo=project-x&bullet=bullet_001&filename=instructions.md" \
-H "Authorization: Bearer {TOKEN}" \
--data-binary @local_instructions.md

Download File

GET /api/bullet/file

Retrieve the raw content of a specific file.

Query Params: owner, repo, bullet, filename
curl "{BASE_URL}/api/bullet/file?owner=myorg&repo=project-x&bullet=bullet_001&filename=instructions.md" \
-H "Authorization: Bearer {TOKEN}"

Update Bullet Status

POST /api/bullet/status

Update the status of a specific task (e.g., success, failure).

Query Params: owner, repo, bullet
curl -X POST "{BASE_URL}/api/bullet/status?owner=myorg&repo=project-x&bullet=bullet_001" \
-H "Authorization: Bearer {TOKEN}" \
-d "success"

Append Log

POST /api/bullet/log

Append a text line to the logs.md file of a specific bullet.

Query Params: owner, repo, bullet
curl -X POST "{BASE_URL}/api/bullet/log?owner=myorg&repo=project-x&bullet=bullet_001" \
-H "Authorization: Bearer {TOKEN}" \
-d "Error: Dependency missing"