Skip to content

forkpress init

forkpress init creates a new ForkPress site and seeds the local main WordPress branch.

Run it once from the project directory before starting the preview server or creating branches.

Usage

Terminal window
forkpress init [options]

Options

OptionDefaultDescription
--work-dir <path>.forkpressSite state directory. ForkPress writes metadata, runtime files, logs, locks, storage state, and the site manifest here.
--php-bin <path>Embedded PHPPHP binary used while preparing and initializing the runtime.
--site-title <title>ForkPressSite title written to the local WordPress configuration.
--root-host <host>wp.localhostRoot host used in generated output and local preview hints.
--admin-password <password>RandomPassword for the seeded local admin user. If omitted, ForkPress generates a random password and prints it once.

What It Creates

For production COW storage, init prepares the embedded runtime, selects the available file-view strategy, creates the main branch, writes .forkpress/site.toml, and records branch metadata under .forkpress/cow/.

The usual project shape after initialization is:

.forkpress/ # ForkPress runtime, metadata, logs, locks, and storage state
main/ # materialized WordPress tree for the main branch

The main branch contains an ordinary WordPress tree. Its database lives at main/wp-content/database/.ht.sqlite.

Examples

Create a site with generated admin credentials:

Terminal window
forkpress init

Create a site with a known local admin password:

Terminal window
forkpress init --admin-password admin

Use a custom state directory:

Terminal window
forkpress init --work-dir .fp

Use a custom root host for preview URLs:

Terminal window
forkpress init --root-host wp.test

Notes

init refuses to run when the selected --work-dir already contains a ForkPress site manifest. To create another site, use a different project directory or a different --work-dir.

Production ForkPress always initializes the materialized COW strategy. The experimental forkpress-dev binary may expose additional storage strategies.

Next Steps

Start previews with forkpress serve, then create branches with forkpress branch create.