── CORE CONCEPTS ──

Stack Detection

Exo automatically detects your project's language and framework by scanning for marker files.

## How Detection Works

The internal/detector package scans the current directory for known marker files and returns a StackInfo struct.

internal/detector/detect.go
1type StackInfo struct {
2 Language string // "go", "node", "python", "java", "rust", "unknown"
3 Framework string // "gin", "express", "flask", "spring", etc.
4 Files []string // Marker files found
5}

## Detection Matrix

Marker FileLanguageFramework Detection
go.modGoChecks imports for gin, echo, fiber, chi
package.jsonNode.jsChecks deps for express, react, next, fastify, koa, nest
requirements.txtPythonChecks for flask, django, fastapi
PipfilePythonSame framework detection as requirements.txt
setup.pyPythonSame framework detection as requirements.txt
pyproject.tomlPythonSame framework detection as requirements.txt
pom.xmlJavaChecks for spring-boot, quarkus, micronaut
build.gradleJavaChecks for spring, quarkus, micronaut
Cargo.tomlRustChecks for actix-web, axum, rocket, warp
None foundUnknownFalls back to wizard prompt

## Detection Flow


  ┌─────────────────┐
  │   Scan CWD for  │
  │   marker files  │
  └────────┬────────┘
           │
     ┌─────▼─────┐      ┌─────────────────────┐
     │ go.mod ?  ├─Yes──▸│ Language: Go        │
     └─────┬─────┘      │ Scan go.mod imports  │
           │No           └─────────────────────┘
     ┌─────▼─────────┐  ┌─────────────────────┐
     │ package.json ?├─Yes─▸│ Language: Node  │
     └─────┬─────────┘  │ Scan dependencies    │
           │No           └─────────────────────┘
     ┌─────▼───────────────┐  ┌────────────────┐
     │ requirements.txt /  ├─Yes─▸│ Language:  │
     │ Pipfile / setup.py /│  │ Python         │
     │ pyproject.toml      │  └────────────────┘
     └─────┬───────────────┘
           │No
     ┌─────▼──────────────────┐  ┌─────────────┐
     │ pom.xml / build.gradle?├─Yes─▸│ Java    │
     └─────┬──────────────────┘  └─────────────┘
           │No
     ┌─────▼─────────┐  ┌──────────────────────┐
     │ Cargo.toml ?  ├─Yes─▸│ Language: Rust  │
     └─────┬─────────┘  └──────────────────────┘
           │No
     ┌─────▼─────────┐
     │ Language:      │
     │   "unknown"    │
     └───────────────┘

## Go Framework Detection

When go.mod is found, Exo reads its contents and checks for known framework import paths:

go
1frameworks := map[string]string{
2 "github.com/gin-gonic/gin": "gin",
3 "github.com/labstack/echo": "echo",
4 "github.com/gofiber/fiber": "fiber",
5 "github.com/go-chi/chi": "chi",
6}

## Node.js Framework Detection

When package.json is found, dependencies are checked:

go
1// Detected: express, react, next, fastify, koa, nest
2frameworks := []string{"express", "react", "next", "fastify", "koa", "nest"}
3for _, fw := range frameworks {
4 if strings.Contains(packageJSON, fw) {
5 return fw
6 }
7}

## Python Framework Detection

When any Python marker is found, the requirements file is checked:

go
1// Detected: flask, django, fastapi
2frameworks := []string{"flask", "django", "fastapi"}
3lower := strings.ToLower(requirementsContent)
4for _, fw := range frameworks {
5 if strings.Contains(lower, fw) {
6 return fw
7 }
8}

## Java Framework Detection

When pom.xml or build.gradle is found:

go
1// Detected: spring-boot (spring), quarkus, micronaut
2javaFrameworks := []string{"spring-boot", "spring", "quarkus", "micronaut"}
3for _, fw := range javaFrameworks {
4 if strings.Contains(lower, fw) {
5 return fw
6 }
7}

## Rust Framework Detection

When Cargo.toml is found:

go
1// Detected: actix-web, axum, rocket, warp
2rustFrameworks := []string{"actix-web", "axum", "rocket", "warp"}
3for _, fw := range rustFrameworks {
4 if strings.Contains(lower, fw) {
5 return fw
6 }
7}

## Using the Scan Command

Run exo scan to see what Exo detects:

bash
$ exo scan
Scanning current directory...
Language: go
Framework: gin
Files found: go.mod, go.sum, main.go
Detection complete.