Devflare Docs
Preview lifecycle Ship & operate

Inspect and clean up previews

The preview registry is D1-backed, giving Devflare durable records of scope and deployment state for reliable cleanup.

Preview commands are the public surface for understanding what exists and tearing down preview-only resources.

Best for
Preview lifecycle management
Registry backing
D1 ( by default)
Cleanup warning
Dedicated preview workers may own more than just the script

Why the registry exists

Cloudflare discovery alone is not enough for clean preview lifecycle management. The D1-backed registry tracks scope and deployment records for reliable inspection and cleanup.

Devflare creates and updates the registry as preview deploys happen, so and work from real state.

Core commands

  • — summary view of preview scopes.
  • — which workers reference one named scope.
  • Prefer explicit scope selectors when you know the target; reserve broad cleanup for when the whole fleet needs attention.
  • Without , respects , , or , then falls back to the synthetic scope. Use for every discovered scope.

PR-close cleanup job for a named preview scope

Turn the same cleanup command into reviewable automation so closed PR previews do not rely on memory.

Preview lifecycle commands

Code sample type: bash

Cleanup should be specific

  • Without , cleanup runs as a dry run — showing what would be removed without touching anything.
  • With , it deletes preview-only resources and can delete dedicated preview worker scripts.
  • Stable shared workers are not deleted; same-worker uploads only lose matching preview-scoped resources.
  • Analytics Engine datasets and Browser Rendering bindings are reported as warnings. Hyperdrive cleanup only removes configs that already exist.

Good cleanup hygiene

Use the most specific selector you can. Cleanup is easier to trust when the target is obvious.

Not every preview-looking thing is deletable

Browser Rendering has no account-scoped resource, Analytics Engine datasets are created on first write, and Hyperdrive cleanup can only remove existing preview configs. The command tells you.

Previous

devflare/cloudflare

The subpath exposes the same account-aware building blocks the CLI uses for auth, resource inventory, usage and limits, preview registry access, preferences, and managed token workflows.

Next

Testing & automation

Local harness detail stays on the testing pages. This page covers what gets promoted into CI and how automation stays observable.