Conversation
|
View your CI Pipeline Execution ↗ for commit 2aa1d81
☁️ Nx Cloud last updated this comment at |
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
6d81822 to
9357cfd
Compare
6b03e96 to
fefe727
Compare
There was a problem hiding this comment.
✅ The fix from Nx Cloud was applied automatically
These changes fix the ESLint linting errors in the agentic mode implementation by adding periods to command descriptions in ai-output.ts. The @nx/workspace/valid-command-object rule requires all command descriptions to end with a period for consistency across the codebase.
Tip
✅ We verified this fix by re-running nx:lint.
Suggested Fix changes
diff --git a/packages/nx/src/command-line/nx-cloud/connect/ai-output.ts b/packages/nx/src/command-line/nx-cloud/connect/ai-output.ts
index 153c8fb5c5..729460de4b 100644
--- a/packages/nx/src/command-line/nx-cloud/connect/ai-output.ts
+++ b/packages/nx/src/command-line/nx-cloud/connect/ai-output.ts
@@ -175,11 +175,11 @@ export function buildMissingVcsResult(): NeedsInputResult {
{
command: 'gh repo create --source=. --push',
description:
- 'Create a GitHub repo and push (requires GitHub CLI: brew install gh)',
+ 'Create a GitHub repo and push (requires GitHub CLI: brew install gh).',
},
{
command: 'git remote add origin <url> && git push -u origin main',
- description: 'Manual: Add remote and push to existing repo',
+ description: 'Manual: Add remote and push to existing repo.',
},
],
recommendedOption: 'gh repo create --source=. --push',
🎓 Learn more about Self-Healing CI on nx.dev
| writeAiOutput( | ||
| buildSuccessResult({ | ||
| nxVersion: version, | ||
| projectsDetected: 1, // Simplified for Phase 1 |
There was a problem hiding this comment.
is this fully implemented? or is phase 2 the NEXT_STEPS.md stuff we were talking about?
| ); | ||
| } | ||
|
|
||
| printFinalMessage({ |
There was a problem hiding this comment.
do we want to include this in a JSON in ai mode?
## Current Behavior `nx init` always uses human-readable output with interactive prompts. When run by AI agents, it doesn't provide structured output. ## Expected Behavior When an AI agent runs `nx init`: - Outputs NDJSON for structured parsing - Applies sensible defaults (non-interactive, skip nx cloud) - Returns `needs_input` with plugin selection options when plugins detected - Returns structured success/error results with user next steps ## Related Issue(s) Related to NXA-921
Current Behavior
When AI agents (Claude Code, Cursor, Windsurf, etc.) run
nx init, the command works but:Expected Behavior
When
nx initdetects an AI agent (via environment variables likeCLAUDE_CODE=1), it should:Changes
This PR adds agentic mode to
nx init:nx initChangesisAiAgent()native functioninteractive=false,nxCloud=false, auto-detect.nxinstallationtype: progress|success|error.nx/ai-errors/with full contextOutput Format
{"type":"progress","step":"starting","message":"Initializing Nx..."} {"type":"success","nxVersion":"22.5.0","projectsDetected":1,"pluginsInstalled":["@nx/vite"]}Or on error:
{"type":"error","message":"Failed to install","code":"INSTALL_ERROR","errorLogPath":".nx/ai-errors/nx-init-error-2025-01-15T10-30-00.log"}Related Issue(s)
Part of NXA-921 (agentic mode initiative)