| title | PR Edit Watcher |
|---|
Flow supports editing GitHub PR title/body from local Markdown files stored in ~/.flow/pr-edit/.
There are two modes:
- One-shot editor + sync loop:
f pr open edit - Always-on background watcher (recommended):
f server
When f server is running, it starts a lightweight watcher that:
- Watches
~/.flow/pr-edit/(non-recursive) - Debounces per-file changes (about 1.25s after the last write)
- Parses title/body from the markdown
- Updates the PR via GitHub REST (PATCH issue)
- Writes status to
~/.flow/pr-edit/status.json
Endpoints:
GET /pr-edit/statusPOST /pr-edit/rescan
Default server URL: http://127.0.0.1:9050
Example:
curl -s http://127.0.0.1:9060/pr-edit/statusEach file must map to a PR. The preferred mapping is YAML frontmatter:
---
repo: owner/repo
pr: 123
---
# Title
My PR title
# Description
Body goes here.If the frontmatter is missing, Flow may fall back to ~/.flow/pr-edit/.index.json (managed by
f pr open edit).
- Title: the first non-empty line under
# Title - Body: everything under
# Description(verbatim)
f pr open edit:
- Finds the open PR for the current branch (fallback: queued commit PR)
- Creates
~/.flow/pr-edit/<project>-<pr>.mdif missing - Ensures the file contains PR frontmatter
- Opens the file in Zed
- Starts a foreground watcher that syncs on save (Ctrl-C to stop)
~/.flow/pr-edit/status.json is written by the always-on watcher and can be used to build a UI.
States:
unknown: file exists but no PR mappingsyncing: change detected and being pushedclean: last sync succeeded, content matches last pushed digesterror: last sync failed (seelast_error)
The watcher uses gh auth token once and caches the token in memory. If syncing fails with auth
errors, run:
gh auth status
gh auth loginStart the server in foreground with debug prints for the PR watcher:
FLOW_PR_EDIT_DEBUG=1 f server foregroundIf the watcher failed to start, GET /pr-edit/status returns HTTP 503 with a detail field.