Run only what changed
Use --affected to run a task only where your branch changed files, plus
every task that depends on one of them.
vx run build --affectedOn a branch, vx compares with the commit where it left your base branch
(main). Add --dry to see what would run and why, without running it:
vx run build --affected --drywould run: ▶ @demo/ui#build cache miss — would exec ea371b1a ~9ms affected: packages/ui/src/index.ts changed (an input) ▶ @demo/web#build cache miss — would exec 3bc7cf82 ~5ms affected: packages/ui/src/index.ts changed (an input), via @demo/ui#build
2 task(s) planned, 2 would run.predicted: ~14ms wall · ~14ms total executionTo compare with another commit, name it:
vx run test --affected=origin/mainvx run test --affected=HEAD~1On the base branch itself there is no default: run --all, and the cache
runs only what changed, so CI on main needs only the current commit.
On a branch, CI’s default one-commit checkout is enough: vx fetches the
base commit and the history down to where the branch started, without
file contents.
See --affected.