> ## Documentation Index
> Fetch the complete documentation index at: https://docs.delixon.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Engines

> Sistema BackendEngine: nexenv-manual, qiloback y motores externos

Nexenv genera proyectos a traves de **engines** (motores) que implementan el
trait `BackendEngine`. Esta arquitectura desacopla la UI de los motores: la
UI llama `generate_scaffold(engine_id, ...)` y el registro despacha al engine
apropiado.

## Engines incluidos

* **`nexenv-manual`** (Free, default): wrapper sobre los templates locales de
  Nexenv. No requiere internet ni cuenta externa.
* **`qiloback`** (Free, cliente): cliente HTTP contra `platform-api` de
  QiloBack. Auth con Bearer token persistido en `~/.nexenv/engines.toml`
  con permisos 0600.

## Conectar QiloBack

Dos formas, ambas guardan el token en `~/.nexenv/engines.toml`:

* **App (GUI):** Settings → Engines → "Conectar con QiloBack" (device flow:
  apruebas en el navegador con tu cuenta, sin copiar tokens).
* **CLI / shell:** `nexenv engines connect` hace el mismo device flow desde la
  terminal. También `nexenv engines set --endpoint <URL> --token <TOKEN>` para
  BYOL/CI. El wizard de creación (GUI, `nexenv new`, `nexenv shell` → `/new`)
  ofrece QiloBack y conectar cuando el stack incluye FastAPI.

## Decisiones vinculantes

* **ADR-001 — Engine tier** (documento interno):
  trait, registry, builtins, cliente QiloBack y MCP local son **todos Free**.
  El recipe marketplace tiene gating mixto Free/Pro.

## Anadir un engine externo

1. Implementar `BackendEngine` (`async fn generate(&self, request) ->
   Result<Vec<File>, EngineError>`).
2. Registrar en `EngineRegistry::register`.
3. Anadir feature flag o variable de entorno si es opcional.

Mas detalle en el documento interno
`vision-roadmap/RFC-001-backend-engine-trait.md`.
