feat(cli): Add Locadex link #936
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Greptile Summary
This PR adds Locadex AI Agent integration to the CLI's init wizard for Next.js projects. When users run
gtx initon a Next.js project, they are now prompted to use the Locadex AI Agent for automatic setup, which opens a GitHub integration URL in the browser. The changes include:setupLocadex()function that opens the Locadex GitHub integration URL using the dynamic import patternThe implementation follows existing patterns in the codebase (similar to
retrieveCredentials()incredentials.ts) and maintains backward compatibility by keeping the traditional setup flow for non-Next.js projects or when users decline the Locadex option.Confidence Score: 5/5
setupLocadex()function follows existing patterns in the codebase, uses the same dynamic import approach ascredentials.ts, and properly handles the URL construction with settings. The init command modification adds a new conditional branch without breaking existing functionality. No console.log statements or debug code were added. The version bump is auto-generated. All changes are additive and maintain backward compatibility.Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant CLI as gtx init participant Base as base.ts participant Setup as setupLocadex() participant Browser participant Dashboard as GT Dashboard User->>CLI: Run gtx init CLI->>Base: Execute init command Base->>Base: Generate settings Base->>Base: Search for package.json Base->>Base: Check if Next.js installed alt Next.js detected Base->>User: Prompt: Use Locadex AI Agent? alt User accepts Base->>Setup: Call setupLocadex(settings) Setup->>Setup: Build URL with dashboardUrl Setup->>Browser: Open GitHub integration URL Browser->>Dashboard: Navigate to /api/integrations/github/start Setup->>User: Display URL in terminal Base->>User: Show completion message else User declines Base->>Base: Check for React alt React detected Base->>User: Prompt: Run React setup wizard? alt User accepts Base->>Base: Run React setup wizard end end Base->>Base: Run handleInitCommand() Base->>User: Show completion message end else Next.js not detected Base->>Base: Check for React alt React detected Base->>User: Prompt: Run React setup wizard? alt User accepts Base->>Base: Run React setup wizard end end Base->>Base: Run handleInitCommand() Base->>User: Show completion message end