Commit c54727d
authored
feat(core): add configure-ai-agents command (#32825)
This pull request introduces support for configuring specific AI agents
in Nx workspaces, allowing users to select which agents to set up and
generating only the relevant configuration files for those agents. It
also updates documentation, schemas, and tests to reflect this new, more
flexible approach.
The most important changes are:
**Agent Selection and Configuration:**
* Added the ability to specify which AI agents to configure via an
`agents` array, both in the setup schema (`schema.json`) and the
`CreateWorkspaceOptions` type. The supported agents are: `claude`,
`gemini`, `codex`, `cursor`, and `copilot`. The generator only creates
configuration files for the selected agents, rather than all by default.
[[1]](diffhunk://#diff-f4d0a6778d70986b54028fb1a5a9338ad4db252edd6db4066e7ee87e8d7f28a5R22-R30)
[[2]](diffhunk://#diff-8141dbb37440f99a460b1e23d0c7229cd16338984832faf528d0ff23de179766R40-R50)
[[3]](diffhunk://#diff-ed4e3e85dbc5d3358491bcef52a8f403a9607df8c874ec9dadef7cd2a1eba6c7R89-R121)
* Implemented prompt logic for selecting AI agents interactively during
workspace creation, and exposed available agent types for use in prompts
and configuration.
[[1]](diffhunk://#diff-672af9097acda13d133130b660df34e6ddf6a61a74f9a6d66832255123e8f9b9R16)
[[2]](diffhunk://#diff-672af9097acda13d133130b660df34e6ddf6a61a74f9a6d66832255123e8f9b9R75-R119)
**File Generation Logic:**
* Refactored the `setupAiAgentsGenerator` implementation to generate
only the files relevant to the specified agents (e.g., `CLAUDE.md`,
`.mcp.json` for Claude; `.gemini/settings.json` for Gemini; `AGENTS.md`
for others), and to append to existing files rather than overwrite them.
[[1]](diffhunk://#diff-ed4e3e85dbc5d3358491bcef52a8f403a9607df8c874ec9dadef7cd2a1eba6c7R1-R45)
[[2]](diffhunk://#diff-ed4e3e85dbc5d3358491bcef52a8f403a9607df8c874ec9dadef7cd2a1eba6c7R89-R121)
* Added new utility functions for determining config file paths and
reading agent-specific configuration, improving maintainability and
clarity of file handling logic.1 parent 05227d7 commit c54727d
File tree
32 files changed
+1607
-261
lines changed- docs
- generated
- cli
- manifests
- packages/nx
- documents
- generators
- e2e/nx/src
- packages
- create-nx-workspace
- bin
- src
- internal-utils
- nx
- bin
- src
- ai
- set-up-ai-agents
- command-line
- configure-ai-agents
- native
- ide
- workspace/src/generators/new
32 files changed
+1607
-261
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5639 | 5639 | | |
5640 | 5640 | | |
5641 | 5641 | | |
| 5642 | + | |
| 5643 | + | |
| 5644 | + | |
| 5645 | + | |
| 5646 | + | |
| 5647 | + | |
| 5648 | + | |
| 5649 | + | |
5642 | 5650 | | |
5643 | 5651 | | |
5644 | 5652 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3611 | 3611 | | |
3612 | 3612 | | |
3613 | 3613 | | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
| 3617 | + | |
| 3618 | + | |
| 3619 | + | |
| 3620 | + | |
| 3621 | + | |
| 3622 | + | |
| 3623 | + | |
| 3624 | + | |
3614 | 3625 | | |
3615 | 3626 | | |
3616 | 3627 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1687 | 1687 | | |
1688 | 1688 | | |
1689 | 1689 | | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
1690 | 1699 | | |
1691 | 1700 | | |
1692 | 1701 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
25 | 34 | | |
26 | 35 | | |
27 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3123 | 3123 | | |
3124 | 3124 | | |
3125 | 3125 | | |
| 3126 | + | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
3126 | 3132 | | |
3127 | 3133 | | |
3128 | 3134 | | |
| |||
0 commit comments