deskhand down
deskhand down <branch|slug> [options]Tear down a worktree environment, removing only what deskhand created.
Argument
Section titled “Argument”| Argument | Description |
|---|---|
branch|slug |
Required. Identifies the worktree via the registry. |
| Flag | Description |
|---|---|
--keep-branch |
Remove the worktree but leave the git branch in place. |
--force |
Proceed without interactive confirmation. |
Confirmation
Section titled “Confirmation”down is destructive, so by default it asks for interactive confirmation. When
input is non-interactive (no TTY — the normal case for AI agents and CI), it
does not silently proceed: without --force it fails fast with an actionable
message. Unattended callers should always pass --force.
What it does
Section titled “What it does”- Look up the registry record. If none exists,
downrefuses to act destructively and says so — it never infers database names from the slug. - Drop only the databases that record lists as deskhand-created. A shared (base project) database is never dropped.
- Remove the storage symlink as a link — never following it into its target.
- Remove the worktree and prune orphaned refs; remove the branch unless
--keep-branch. - Release allocated ports.
- Remove the registry entry (last, so an interrupted teardown is retryable).
See the Safety model for the guarantees behind teardown.