CLI Reference

Workspace Verbs

Reference for checkout, code, run, exec, shell, sync, diff, info and rm — the verbs that take a project and a ref.

These verbs take a project and a ref:

uxd <project> <ref> <verb> [flags] [-- passthrough]

checkout

Materializes the workspace and prints its path on stdout. This is the default verb, and the one to use from scripts.

uxd my-project feat/login checkout
→ fetching origin/feat/login
→ worktree ready: ~/dev/uxd/my-project/trees/feat-login
FlagEffect
--fetchForce a re-fetch before materializing
--setupAlso run [setup] (off by default for checkout)
--no-setupSkip [setup]
--jsonPrint a result object instead of the path
uxd my-project feat/login checkout --json
{"project":"my-project","slug":"feat-login","ref":"feat/login","kind":"branch","branch":"feat/login","path":"~/dev/uxd/my-project/trees/feat-login","ports":[3053],"created":true}

code

Materializes if needed, then opens the workspace in your editor.

uxd my-project 42 code
uxd my-project 42 code --editor vim
FlagEffect
--editor <cmd>Override the configured editor for this run
--fetchRe-fetch before opening
--setup / --no-setupForce or skip [setup]

--json is not supported for code.

run <name>

Materializes, runs [setup], then the named command from [commands] inside the worktree. Passthrough args are appended.

uxd my-project 42 run dev
uxd my-project 42 run test -- --watch
FlagEffect
--no-setupSkip [setup]
--reseedRe-copy seed files before running
--fetchRe-fetch before running
--port <n>Override the allocated port for this invocation
--env K=VAdd or override one environment variable (repeatable)

--dry-run prints the computed environment as export lines followed by the shell-quoted command, and runs nothing.

exec -- <argv…>

Like run, but for an ad-hoc command spawned directly — no shell, so no quoting surprises.

uxd my-project 42 exec -- pnpm test
uxd my-project 42 exec --no-setup -- git log --oneline -5

Accepts the same environment flags as run.

shell

An interactive shell inside the workspace with the full uxd environment exported ($UXD_PORT, $UXD_PATH, $UXD_DATA_DIR, …).

uxd my-project 42 shell
uxd my-project - shell

sync

Re-fetches the ref and hard-resets the worktree to it.

uxd my-project 42 sync
FlagEffect on local changes
(none)Refuses if the tree is dirty
--stashStash them, then reset
--discardDiscard them, then reset
--freshRemove the worktree and re-materialize from scratch
--stash, --discard and --fresh are mutually exclusive.

See Refresh a workspace.

diff

For a PR workspace with gh available, renders gh pr diff against the real PR base. Otherwise falls back to git diff <merge-base>...HEAD in the worktree.

uxd my-project 42 diff
uxd my-project 42 diff --stat
uxd my-project 42 diff --tool
uxd my-project 42 diff -- --color-words
FlagEffect
--statSummary instead of full patch
--toolUse git difftool (always local, never gh)

info

One workspace in detail.

uxd my-project feat/login info
slug: feat-login
kind: branch
ref: feat/login
branch: feat/login
path: ~/dev/uxd/my-project/trees/feat-login
ports: 3053
status: clean
created: 2026-07-25T05:51:38.363Z
last used: 2026-07-25T05:51:38.827Z
FlagEffect
--duInclude on-disk size
--jsonMachine-readable object

rm

Removes one workspace.

uxd my-project 42 rm
uxd my-project 42 rm --force --yes
FlagEffect
--forceRemove even if the worktree is dirty (discards changes)
--yesSkip the confirmation prompt

To remove several at once, use clean.