deskhand up
deskhand up <branch> [options]Provision a fully runnable, verified, isolated environment for <branch>.
If the branch exists, deskhand attaches to it; if not, it creates it.
Argument
Section titled “Argument”| Argument | Description |
|---|---|
branch |
Required. The git branch to provision a worktree for. |
| Flag | Description |
|---|---|
--path=<dir> |
Worktree location. Default: .claude/worktrees/<slug> relative to the repo root. |
--db=<engine> |
sqlite (default) or mysql. |
--shared-db |
Use the base project’s database instead of an isolated one — for read-only sessions. Skips DB creation, migrate, and seed, and points the worktree .env at the shared DB. |
--no-envaudit |
Skip the envaudit gate. |
--no-redis-isolation |
Skip Redis prefix/index injection even if Redis is detected. |
--no-verify |
Skip the Pest verification step (provision only). |
--url=<value> |
Override the reported worktree URL. Accepts a literal URL or a template with {slug}/{port} (e.g. --url=https://{slug}.acme.test). Authoritative; persisted in the registry. |
What it does
Section titled “What it does”- Preflight — confirm a git repo, load config, detect capabilities, and
idempotently add deskhand’s managed block to
.gitignore. - Resolve the slug and derived names (DB names, ports,
APP_NAMEtag). - Create the worktree (attach or create the branch).
- Materialize env — copy
.env→ worktree.envand.env.testing, injecting per-worktree overrides..env.testingalways forces safe drivers. - Install dependencies —
composer install, plus a JS install if a frontend is detected. - Generate a fresh
APP_KEY. - Provision storage and run
storage:link. - Create the isolated database (unless
--shared-db), recording it in the registry at creation time. - Migrate (and seed if configured) — skipped entirely under
--shared-db. - Run
post_up_hooks. - envaudit gate — run the project’s installed envaudit; skipped with an
actionable message if it isn’t installed, or entirely with
--no-envaudit. - Verify — run the test command;
upsucceeds only if the suite is green. - Finalize the registry and report — slug, branch, path, DB name(s), ports, URL, and health.
Idempotency
Section titled “Idempotency”Re-running up on an existing deskhand-managed worktree repairs, never
corrupts: it re-materializes a missing .env, re-installs missing dependencies,
re-creates a missing database (without dropping data it already created), and
re-verifies. It never duplicates registry entries.