Hashline
Read and edit files using content-addressed hashes instead of plain line numbers. Each line is identified by a combinedlineNumber#hash reference, so edits fail predictably when the file has changed since you last read it.
All endpoints require an authenticated admin session. The caller’s email must appear in the server’s
ADMIN_EMAILS allowlist; ordinary authenticated users receive 403 Forbidden. File paths must resolve to a location within the project directory.Read file with hashes
Query parameters
Response (JSON format)
Response (CLI format)
Whenformat=cli, the response is plain text with Content-Type: text/plain. Each line is formatted as:
Errors
Apply an edit
409 and suggests similar lines.
Request body (single edit)
Request body (batch edit)
Response (single edit)
Response (batch edit)
success is true only when every edit in the batch succeeds.
Stale line recovery
When a hash reference does not match any line in the current file, the API returns a409 with suggestions:
GET /api/hashline and retry with an updated hash reference.
Errors
Delete a backup
.backup. in their name can be deleted through this endpoint.
Query parameters
Response
Errors
Hash reference format
A hash reference combines a line number and a short content hash:12#A3 refers to line 12 with hash A3. You can also use #A3 without the line number, though including the line number improves match accuracy when hashes collide.
The hash is derived from the trimmed content of the line. Two lines with identical content after trimming share the same hash. The stats.hashCollisions field in the read response tells you how many lines share a hash.