TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/getployz/ployz/llms.txt
Use this file to discover all available pages before exploring further.
branch command forks one namespace into another. It is Ployz’s primitive for creating ephemeral environments — PR previews, staging clones, A/B variants — without duplicating data unnecessarily. Branching is a single atomic operation. The source namespace continues to run unaffected.
Resource modes
When branching a namespace, each resource (service, volume) can be in one of two modes:| Mode | Meaning |
|---|---|
branch | Copy-on-write fork. The resource shares the source’s data until it diverges. For volumes, this is an instant ZFS clone. |
fresh | Empty or newly created resource. The target starts with no data from the source. |
branch for services and fresh for volumes. You can override the default for all resources of a type, or set per-resource overrides by name.
Subcommands
preview — preview what branching would do
preview — preview what branching would do
Compute the branch plan and return what would be created, cloned, and configured — without applying anything. Use this to inspect the plan before committing.
The source namespace to fork from.
The target namespace to create. Must not already exist.
Default mode for all services in the branched namespace.
Default mode for all volumes in the branched namespace.
Per-service mode override. Format:
--service myservice=fresh. Can be specified multiple times.Per-volume mode override. Format:
--volume myvolume=branch. Can be specified multiple times.prepare — prepare a branch without applying
prepare — prepare a branch without applying
Prepare the branch operation and return a prepared deploy ID without executing it. The prepared ID can be stored and applied later with Accepts the same flags as
apply-prepared. This enables two-phase workflows where the branch is computed in CI but applied from a separate process.preview. The response includes a prepared_deploy_id that you pass to apply-prepared.Prepared deploys expire. Check the
expires_at field in the response and apply before the deadline.apply — apply a branch operation
apply — apply a branch operation
Execute the branch operation atomically. The target namespace is created with services and volumes according to the specified resource modes.
The source namespace to fork from.
The target namespace to create.
Default mode for all services.
Default mode for all volumes.
Per-service mode override. Can be specified multiple times.
Per-volume mode override. Can be specified multiple times.
apply-prepared — apply a previously prepared branch
apply-prepared — apply a previously prepared branch
Apply a branch operation that was previously computed by
prepare. The prepared-deploy-id identifies the prepared plan.The prepared deploy ID returned by
branch prepare.render-manifest — render the branch manifest
render-manifest — render the branch manifest
Render the TOML manifest that the branch operation would generate, without applying or preparing it. Useful for auditing or storing the manifest in version control.Accepts the same positional arguments and flags as
apply. Outputs the manifest to stdout.PR branching workflow
The following steps show a typical pull request branching workflow, where each PR gets its own isolated environment forked from production.Preview the branch plan
Run
branch preview to confirm which services and volumes will be cloned versus started fresh.Apply the branch
When the plan looks correct, apply the branch. The target namespace is created atomically.