nx-run-taskslisted
Install: claude install-skill skyf0xx/hedgehog
Run tasks via `pnpm nx` (see the `nx-workspace` skill for the pnpm-only convention and for checking which targets a project has before running one).
For more details on any command, run it with `--help` (e.g. `pnpm nx run-many --help`, `pnpm nx affected --help`).
## Run a single task
```
pnpm nx run <project>:<task>
```
where `project` is the project name defined in `package.json` or `project.json` (if present).
## Run multiple tasks
```
pnpm nx run-many -t build test lint typecheck
```
You can pass a `-p` flag to filter to specific projects, otherwise it runs on all projects. You can also use `--exclude` to exclude projects, and `--parallel` to control the number of parallel processes (default is 3).
Examples:
- `pnpm nx run-many -t test -p proj1 proj2` — test specific projects
- `pnpm nx run-many -t test --projects=*-app --exclude=excluded-app` — test projects matching a pattern
- `pnpm nx run-many -t test --projects=tag:api-*` — test projects by tag
## Run tasks for affected projects
Use `pnpm nx affected` to only run tasks on projects that have been changed and projects that depend on changed projects. This is especially useful in CI and for large workspaces.
```
pnpm nx affected -t build test lint
```
By default it compares against the base branch. You can customize this:
- `pnpm nx affected -t test --base=main --head=HEAD` — compare against a specific base and head
- `pnpm nx affected -t test --files=libs/mylib/src/index.ts` — specify changed files directl