Resume An Existing Draft

A draft is an editable set of files that belongs to a site. The CLI and MCP share draft IDs and revision numbers, so you can start in one and continue in the other.

Create And Edit

Create a draft with pnpm fold draft. Each edit takes the revision you expect the draft to be at and returns the next one.

pnpm fold draft write DRAFT_ID 0 index.md content/index.md
pnpm fold draft read DRAFT_ID
pnpm fold draft read DRAFT_ID index.md --revision 1
pnpm fold draft preview DRAFT_ID 1

Delete a file with pnpm fold draft delete DRAFT_ID REVISION PATH. Deleting the last file leaves an empty draft you can still edit.

To add a local image or other binary file, upload it.

pnpm fold draft upload DRAFT_ID 0 press/cover.jpg ./cover.jpg

Find A Draft Again

pnpm fold drafts lists each draft with its ID and current revision. Pass that revision to your next edit.

When Someone Else Edited First

An edit against an old revision returns a revision conflict and changes nothing. Read the draft's current revision and contents, bring your change up to date, then submit it against that revision.

Read Long Files

A file read returns up to 8,000 characters and the full length of the text. To continue, pass the next offset and the same revision.

pnpm fold draft read DRAFT_ID guide.md --revision 3 --offset 8000

Preview A Revision

pnpm fold draft preview DRAFT_ID REVISION builds a release from exactly that revision. Later edits to the draft don't change the release. A preview needs at least one file.

Next: Review and activate a release