From 1af2ba9881c3357f1137f531bff1b473fcebf39e Mon Sep 17 00:00:00 2001 From: kidkender Date: Thu, 12 Nov 2026 16:03:18 +0700 Subject: [PATCH] fix(cli): detect a Gin project whose go.mod is one directory down MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CLI only treated a project as Go when go.mod sat at the root, then asked isGinProject; analysis and the MCP server already rely on isGinProject alone, which also finds a go.mod one directory down (api/, server/) and returns false for a root that has composer.json. Such a project fell through to the Laravel default and showed no routes. On zgiai/zgi (go.mod in api/): Laravel, 0 routes → Go, 226 routes. ginfast (go.mod at the root) unchanged; isGinProject is false for the Laravel, Spring Boot, NestJS and Express projects checked. --- apps/cli/src/utils/parse-project.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/cli/src/utils/parse-project.ts b/apps/cli/src/utils/parse-project.ts index 2392940..1fc1761 100644 --- a/apps/cli/src/utils/parse-project.ts +++ b/apps/cli/src/utils/parse-project.ts @@ -96,8 +96,9 @@ export function detectFramework(projectRoot: string): Framework { // go.mod is a strong, cheap-to-check signal unique to Go — checked before // the fallback heuristics below so a Gin project never falls through to - // the Laravel default. - if (existsSync(join(projectRoot, "go.mod")) && isGinProject(projectRoot)) return "go" + // the Laravel default. isGinProject also finds a go.mod one directory down + // (api/, server/), as analysis and the MCP server do. + if (isGinProject(projectRoot)) return "go" // Fallback heuristics if (existsSync(join(projectRoot, "artisan"))) return "laravel"