Skip to content

forkpress agents

forkpress agents creates multiple ForkPress branches and matching Git worktrees for parallel editing.

Use it after the site is initialized and the preview server is available at the configured Git remote.

Usage

Terminal window
forkpress agents [dir] [options]

Arguments And Options

Argument or optionDefaultDescription
dirforkpress-agentsDirectory that will hold the main checkout and agent worktrees.
--work-dir <path>.forkpressSite state directory used for local branch creation.
--php-bin <path>Embedded PHPPHP binary used by runtime helpers.
--remote <url>http://wp.localhost:18080/site.gitGit remote to clone or fetch.
--count <n>10Number of agent branches and worktrees to create. Must be greater than zero.
--prefix <prefix>agentBranch name prefix. Branches are named <prefix>-1, <prefix>-2, and so on.
--from <branch>mainParent ForkPress branch to fork from.
--remote-name <name>originName for the configured Git remote.
--user <name>NoneForkPress user for local branch creation when auth is enabled. Must be paired with --password.
--password <password>NoneForkPress password for local branch creation when auth is enabled. Must be paired with --user.

Production COW branch creation does not use --user and --password, but the options remain available for auth-enabled experimental workflows.

What It Does

agents creates or reuses a root directory, ensures a site/ checkout exists inside it, creates the requested ForkPress branches, fetches the remote, and then adds one Git worktree per branch.

With defaults, the result is:

forkpress-agents/
site/ # main checkout
agent-1/ # worktree for branch agent-1
agent-2/ # worktree for branch agent-2
...
agent-10/ # worktree for branch agent-10

Existing worktree directories are reused.

Examples

Create the default ten worktrees:

Terminal window
forkpress agents

Create three review branches:

Terminal window
forkpress agents --count 3 --prefix review

Create branches from a staging branch:

Terminal window
forkpress agents --from staging --count 5

Use another remote URL and destination:

Terminal window
forkpress agents ./client-agents --remote http://wp.localhost:18081/site.git

Working In A Worktree

Each generated worktree is a normal Git checkout. Edit files under wordpress/, then push the branch back to ForkPress:

Terminal window
cd forkpress-agents/agent-1
forkpress commit -m "Agent 1 update"

Preview the result at:

http://agent-1.wp.localhost:18080/