nx-run-tasks
You can run tasks with Nx in the following way.
Keep in mind that you might have to prefix things with npx/pnpx/yarn if the user doesn't have nx installed globally. Look at the package.json or lockfile to determine which package manager is in use.
For more details on any command, run it with --help (e.g. nx run-many --help, nx affected --help).
Understand which tasks can be run
You can check those via nx show project <projectname> --json, for example nx show project myapp --json. It contains a targets section which has information about targets that can be run. You can also just look at the package.json scripts or project.json targets, but you might miss out on inferred tasks by Nx plugins.
Run a single task
nx run <project>:<task>
where project is the project name defined in package.json or project.json (if present).
Run multiple tasks
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:
nx run-many -t test -p proj1 proj2— test specific projectsnx run-many -t test --projects=*-app --exclude=excluded-app— test projects matching a patternnx run-many -t test --projects=tag:api-*— test projects by tag
Run tasks for affected projects
Use 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.
nx affected -t build test lint
By default it compares against the base branch. You can customize this:
nx affected -t test --base=main --head=HEAD— compare against a specific base and headnx affected -t test --files=libs/mylib/src/index.ts— specify changed files directly
Useful flags
These flags work with run, run-many, and affected:
--skipNxCache— rerun tasks even when results are cached--verbose— print additional information such as stack traces--nxBail— stop execution after the first failed task--configuration=<name>— use a specific configuration (e.g.production)
More from zard-ui/zardui
angular-testing
Write unit and integration tests for Angular v21+ applications using Jest with @testing-library/angular, focusing on user-centric testing, AAA pattern, and modern Angular patterns (Standalone components, Signals). Use for testing components, services, and HTTP interactions with Jest globals and Testing Library DOM matchers.
27angular-signals
Implement signal-based reactive state management in Angular v20+. Use for creating reactive state with signal(), derived state with computed(), dependent state with linkedSignal(), and side effects with effect(). Triggers on state management questions, converting from BehaviorSubject/Observable patterns to signals, or implementing reactive data flows.
23angular-http
Implement HTTP data fetching in Angular v20+ using resource(), httpResource(), and HttpClient. Use for API calls, data loading with signals, request/response handling, and interceptors. Triggers on data fetching, API integration, loading states, error handling, or converting Observable-based HTTP to signal-based patterns.
22angular-di
Implement dependency injection in Angular v20+ using inject(), injection tokens, and provider configuration. Use for service architecture, providing dependencies at different levels, creating injectable tokens, and managing singleton vs scoped services. Triggers on service creation, configuring providers, using injection tokens, or understanding DI hierarchy.
22angular-routing
Implement routing in Angular v20+ applications with lazy loading, functional guards, resolvers, and route parameters. Use for navigation setup, protected routes, route-based data loading, and nested routing. Triggers on route configuration, adding authentication guards, implementing lazy loading, or reading route parameters with signals.
21angular-tooling
Use Angular CLI and development tools effectively in Angular v20+ projects. Use for project setup, code generation, building, testing, and configuration. Triggers on creating new projects, generating components/services/modules, configuring builds, running tests, or optimizing production builds.
21