Run The FOLD Authoring Agent

FOLD includes an authoring agent that works on one draft. It can read and edit that draft, request a preview and check the build. It can't publish: a publisher does that separately.

Run It On A Draft

Give the agent a draft, a UUID for the run and an instruction. Then ask for the result with the same draft and UUID.

OPERATION=$(uuidgen)
pnpm fold agent DRAFT_ID "$OPERATION" "Add an opening paragraph to index.md and build a private preview."
pnpm fold result DRAFT_ID "$OPERATION"

Over MCP, the same two steps are agent_submit and agent_result.

If your instruction starts with --, put -- before it so the CLI reads it as text.

How Long A Run Can Work

A run can use its draft tools for 30 minutes after you submit it, even if your access token expires sooner. Every tool call still checks your membership of the site and the scopes you had when you submitted, so removing your access stops the run. Submitting the same run and instruction again with a fresh token renews the 30 minutes.

Try It Locally

With an OpenAI API key in your environment, one command creates a draft, runs the agent and prints its answer. Drafts and run history are kept in .fold/.

FOLD_PI_MODEL=gpt-5.4-mini pnpm agent:run 'Write a short welcome page in index.md and build a private preview.'

To run the agent on a draft you already have, start pnpm dev with the same model setting and use pnpm fold agent as above.

Next: Find pages under a site mount