nx-run-tasks by nrwl/nx-ai-agents-config
npx skills add https://github.com/nrwl/nx-ai-agents-config --skill nx-run-tasks你可以通过以下方式使用 Nx 运行任务。
请注意,如果用户没有全局安装 nx,你可能需要添加 npx/pnpx/yarn 前缀。请查看 package.json 或 lockfile 以确定正在使用哪个包管理器。
要获取任何命令的更多详细信息,请使用 --help 运行它(例如 nx run-many --help、nx affected --help)。
你可以通过 nx show project <项目名> --json 来检查,例如 nx show project myapp --json。它包含一个 targets 部分,其中包含有关可运行目标的信息。你也可以直接查看 package.json 中的 scripts 或 project.json 中的 targets,但可能会错过 Nx 插件推断出的任务。
nx run <项目>:<任务>
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
其中 项目 是在 package.json 或 project.json(如果存在)中定义的项目名称。
nx run-many -t build test lint typecheck
你可以传递 -p 标志来筛选特定项目,否则它将在所有项目上运行。你也可以使用 --exclude 来排除项目,并使用 --parallel 来控制并行进程的数量(默认为 3)。
示例:
nx run-many -t test -p proj1 proj2 — 测试特定项目nx run-many -t test --projects=*-app --exclude=excluded-app — 测试匹配模式的项目nx run-many -t test --projects=tag:api-* — 按标签测试项目使用 nx affected 仅对已更改的项目以及依赖于已更改项目的项目运行任务。这在 CI 和大型工作区中尤其有用。
nx affected -t build test lint
默认情况下,它会与基础分支进行比较。你可以自定义此行为:
nx affected -t test --base=main --head=HEAD — 与特定的基础分支和头部进行比较nx affected -t test --files=libs/mylib/src/index.ts — 直接指定已更改的文件这些标志适用于 run、run-many 和 affected:
--skipNxCache — 即使结果已缓存也重新运行任务--verbose — 打印额外信息,例如堆栈跟踪--nxBail — 在第一个任务失败后停止执行--configuration=<名称> — 使用特定配置(例如 production)每周安装量
580
代码仓库
GitHub 星标数
13
首次出现
2026 年 1 月 27 日
安全审计
安装于
github-copilot560
codex557
gemini-cli555
opencode555
kimi-cli550
amp549
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).
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.
nx run <project>:<task>
where project is the project name defined in package.json or project.json (if present).
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 tagUse 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 directlyThese 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)Weekly Installs
580
Repository
GitHub Stars
13
First Seen
Jan 27, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot560
codex557
gemini-cli555
opencode555
kimi-cli550
amp549
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
136,300 周安装