Skip to content

Conversation

@brian-lou
Copy link
Contributor

@brian-lou brian-lou commented Jan 7, 2026

Greptile Summary

This PR adds Locadex AI Agent integration to the CLI's init wizard for Next.js projects. When users run gtx init on 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:

  • Created new setupLocadex() function that opens the Locadex GitHub integration URL using the dynamic import pattern
  • Modified the init command to detect Next.js and offer Locadex as the primary setup option
  • Restructured the setup flow to branch between Locadex and traditional React setup wizard
  • Version bumped to 2.5.41

The implementation follows existing patterns in the codebase (similar to retrieveCredentials() in credentials.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

  • This PR is safe to merge with minimal risk
  • The changes are straightforward and well-structured. The new setupLocadex() function follows existing patterns in the codebase, uses the same dynamic import approach as credentials.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.
  • No files require special attention

Important Files Changed

Filename Overview
packages/cli/src/locadex/setupFlow.ts New file that opens Locadex GitHub integration URL in browser
packages/cli/src/cli/base.ts Added Next.js detection to prompt users for Locadex AI Agent setup

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
Loading

@brian-lou brian-lou requested a review from a team as a code owner January 7, 2026 21:59
if (useAgent) {
await setupLocadex(settings);
logger.endCommand(
'Done! The Locadex AI Agent will run in the background and setup your project. See the docs for more information: https://generaltranslation.com/docs'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"set up" (with space) instead of "setup"

@brian-lou brian-lou enabled auto-merge (squash) January 7, 2026 22:07
@brian-lou brian-lou merged commit 45ee200 into main Jan 7, 2026
19 checks passed
@brian-lou brian-lou deleted the b/cli/update-wizard branch January 7, 2026 22:14
@github-actions github-actions bot mentioned this pull request Jan 7, 2026
brian-lou pushed a commit that referenced this pull request Jan 7, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## [email protected]

### Patch Changes

- [#936](#936)
[`45ee200`](45ee200)
Thanks [@brian-lou](https://github.com/brian-lou)! - Create Locadex AI
Agent link in gtx-cli init command

## [email protected]

### Patch Changes

- Updated dependencies
\[[`45ee200`](45ee200)]:
    -   [email protected]

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants