Quick Start

Run FOLD on your machine, build a private preview of one page, publish it and roll it back. You need Node 26 and pnpm 10.34.5, and a checkout of the FOLD repository.

Start The Server

From the root of the checkout, install the dependencies and start the local server.

pnpm install --frozen-lockfile
pnpm dev

The server prints a line that starts with export. Copy it into a second terminal at the same directory. It sets FOLD_API, FOLD_SITE and FOLD_TOKEN: the API address, the demo site and a publisher token that lasts one day. The server listens on port 8787 and keeps its data under .fold/.

For a first look without the second terminal, run pnpm ops local. It starts a server on port 8788, builds a sample page and prints its preview URL.

Preview

Write one page and build a release from its directory.

content_dir=$(mktemp -d)
printf '# Hello from FOLD\n' > "$content_dir/index.md"
pnpm fold preview "$content_dir"

The response holds a release ID and a previewUrl. Save both.

Check Status

pnpm fold status RELEASE_ID

Run it until the state is ready, then open the preview URL. The URL carries a grant that expires one hour after you submitted the preview. If the state is failed, read the diagnostic, correct the source and preview again.

Publish

Read the site's current generation, then publish with the release ID, that generation and a new UUID as the key.

pnpm fold sites
KEY=$(uuidgen)
pnpm fold publish RELEASE_ID CURRENT_GENERATION "$KEY"

Run pnpm fold sites again. When the generation has advanced, the release is live at http://demo.localhost:8787/. If you aren't sure a publish went through, run it again with the same arguments and key. Publish retries

Roll Back

Publish a second release, then make the first one live again.

pnpm fold rollback EARLIER_RELEASE_ID CURRENT_GENERATION NEW_UUID

Rollback takes the generation the site has now and a key you haven't used. It also advances the generation. Roll back

Use A Hosted FOLD

The commands are the same. Set FOLD_API to the address your FOLD gives you, sign in, and pick a site.

export FOLD_API=https://api.example.com
fold login
fold sites
export FOLD_SITE=SITE_ID

Where there's no browser, such as over SSH, use fold login --device and approve the printed code from another device. An installed CLI is run as fold. Inside the FOLD checkout the same command is pnpm fold.

Next: Directory inputs and routes