Guides

Review a Pull Request

Take a PR from a link to a running app you can click through, then dispose of it when it merges.

Reading a diff tells you what changed. Running the branch tells you whether it works. This is the workflow uxd was built for.

You need a configured project with a [commands.dev] entry, and the PR number.

Open the PR in your editor

uxd my-project 42 code

This resolves 42 as a pull request, materializes the worktree if it does not exist, and launches your configured editor. Running it again is cheap — the workspace is reused.

Have a link rather than a number? Paste the whole URL:

uxd https://github.com/my-org/my-project/pull/42 code

uxd matches the URL to the project by host, owner, and repository name, and consumes the /pull/42 segment as the ref.

Run it

uxd my-project 42 run dev

Same workspace. uxd runs [setup] first — installing dependencies only if the files in setup.cache_key changed — then starts your dev server on the workspace's own port.

→ worktree ready (reused)
→ running setup
...
listening on 3053

Need a different port for this run only?

uxd my-project 42 run dev --port 6000
Two PRs open at once? Run both. Each workspace holds its own port block, so the servers do not collide. See Run dev servers in parallel.

Read the diff

uxd my-project 42 diff
uxd my-project 42 diff --stat

With gh installed and authenticated, this renders gh pr diff against the true PR base. Without gh, it falls back to git diff <merge-base>...HEAD inside the worktree.

 login.txt | 1 +
 1 file changed, 1 insertion(+)

Prefer your difftool? --tool always runs locally:

uxd my-project 42 diff --tool

Poke at it

uxd my-project 42 shell                      # interactive shell, uxd env exported
uxd my-project 42 exec -- pnpm test          # one-off command
uxd my-project 42 exec --no-setup -- git log --oneline -5

shell exports the full uxd environment — $UXD_PORT, $UXD_PATH, $UXD_DATA_DIR — so anything you run by hand sees the same values your configured commands do.

Pick up new commits

The author pushed a fix. Bring the workspace up to date:

uxd my-project 42 sync

sync refuses to touch a dirty tree. If you have local edits, decide what happens to them: --stash, --discard, or --fresh to rebuild from scratch. See Refresh a workspace.

Clean up after the merge

uxd my-project clean --merged

clean prints a plan and asks before deleting. Run it whenever your workspace list gets long — or make it a habit on Fridays. See Clean up workspaces.

Reviewing a fork PR

Fork pull requests work the same way. When gh is available, uxd wires push-back for you, so commits you make in the workspace can be pushed to the contributor's branch.

Without gh, checkout of refs/pull/<n>/head still works against GitHub and GitHub Enterprise — you just lose the PR metadata and push-back wiring. Check what you have with uxd doctor.