Reset
The dwe reset run command tears down the project or a single service and
returns it to a clean state that requires a subsequent deploy.
Project-wide reset
Section titled “Project-wide reset”dwe reset run [--yes] [--skip-preflight] [--clear-generated]Executes workspace/reset.yml. The file is optional — when absent, DWE uses the built-in default reset pipeline and prints one info line to stderr: Using built-in default reset pipeline (override with workspace/reset.yml). The info line is suppressed in --output json mode.
Default reset pipeline (fires when workspace/reset.yml is absent):
Phases: pre (confirm prompt: “This will stop containers, remove project volumes, and delete generated data.”) → stop (type: dwe, cmd: "docker down") → cleanup (remove all project volumes, then remove the services/ directory). Volume removal is resilient: an individual volume that cannot be dropped (e.g. still in use) is reported and skipped so it does not abort the reset, while a genuinely broken setup — project name unresolvable or docker volume ls failing — stays fatal (the reset aborts rather than clearing the journal with volumes left behind).
On success the entire deploy state journal is
removed, so every service appears as not-deployed in dwe status.
| Option | Description |
|---|---|
--yes / -y | Skip confirmation prompts inside reset steps |
--skip-preflight | Bypass environment probes and project checks before running |
--clear-generated | Also clear the harvested generated-value store (.dwe/generated.yml) so secrets regenerate on the next deploy (preserved by default) |
Per-service reset
Section titled “Per-service reset”dwe reset run --service <name> [--yes] [--skip-preflight] [--clear-generated]Resets a single service without touching the rest of the project:
- Runs stop-stage preflight checks (docker, git binaries; port availability check is skipped for stop stage).
- Shows an interactive confirmation form listing exactly what will happen (skipped with
--yes). - If the service is currently enabled, runs any
on_disable.beforeuser commands declared inworkspace/services/<name>/service.yml(outside the project lock). - Acquires the project lock, then executes a single pipeline composed of:
a. Baseline (always-on): stop and remove the service container directly via
docker stop+docker rm -f(bypasses compose — works whether the service is enabled or disabled). b. Baseline (conditional): delete the service directory if the service declaresdir:inservice.ymland the directory exists on disk. c. User pipeline (optional): the phases declared inworkspace/services/<name>/reset.ymlif present, appended after the baseline. - Atomically removes the service’s deployed state from the journal and writes a
PendingDeployentry. - Releases the lock.
After a per-service reset, dwe status shows a pending-deploy banner for
the service. Run dwe deploy run --service <name> to re-provision it.
Volumes are not touched automatically. If you need to drop the service’s
Docker volumes as part of reset, declare a services/<name>/reset.yml with a
step calling docker_remove_project_volumes.
Requirements
Section titled “Requirements”- The service must exist in
workspace/services/<name>/. - The service must have
workspace/services/<name>/deploy.yml— per-service reset writes aPendingDeployjournal entry, so the service must be deployable. If there is nodeploy.yml, use the fulldwe reset runinstead.
Required services (required: true) are allowed to be per-service reset (required protects
from services disable, not from reset).
| Option | Description |
|---|---|
--service <name> | Reset only this service |
--yes / -y | Skip the confirmation prompt |
--skip-preflight | Bypass environment probes before running |
--clear-generated | Also clear this service’s harvested generated values (.dwe/generated.yml); forces regeneration on next deploy |
Per-service reset.yml
Section titled “Per-service reset.yml”workspace/services/<name>/reset.yml follows the same format as the project-wide
workspace/reset.yml. It is optional and is appended after the always-on
baseline (container stop+rm, optional dir: removal). When absent, only the
baseline and the journal update occur.
phases: - name: wipe steps: - name: drop-volume type: builtin cmd: docker_remove_project_volumesPending state lifecycle
Section titled “Pending state lifecycle”| Command | Effect on journal |
|---|---|
dwe reset run --service <name> | Removes state.services.<name>, writes PendingDeploy for <name> |
dwe deploy run --service <name> | Clears PendingDeploy for <name> on success |
dwe reset run (project-wide) | Deletes the entire state file (journal.Remove) |