Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions plugins/lt-dev/skills/using-lt-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ description: 'Provides reference for the lenne.tech CLI tool (lt command). Cover
- **`lt git reset` is DESTRUCTIVE and irreversible** — Lives next to the safe `lt git get` in the CLI menu. `reset` does `git reset --hard` followed by force-pull, destroying ALL local changes without confirmation. Never run it on a branch with unpushed work. Prefer `git stash` + `lt git get`.
- **`lt server object X --controller` generates REST, NOT GraphQL** — Default is REST. For GraphQL projects, use `--resolver`. The CLI does not auto-detect from existing project patterns — you must specify explicitly.
- **`lt fullstack convert-mode` rewrites the source tree** — Switching between `npm` and `vendor` mode moves framework code in/out of `src/core/` (API) or `app/core/` (App). The operation is reversible but NOT idempotent mid-run — always commit before starting, so a failed conversion can be rolled back via `git reset`.
- **`--next` is experimental and incompatible with `lt server module/object/addProp/test/permissions`** — When `lt server create --next` or `lt fullstack init --next` is used, the API is cloned from [`nest-base`](https://github.com/lenneTech/nest-base) (Bun + Prisma 7 + Postgres + Better-Auth) instead of `nest-server-starter`. The downstream generators target the classic nest-server layout (Mongoose models, src/server/modules/, etc.) and will not work on a nest-base project. Use it for greenfield prototyping only; for production work prefer the default template.

## Skill Boundaries

Expand Down Expand Up @@ -54,7 +55,7 @@ Fetches latest from remote, resets current branch to `origin/<branch>`. **Destru
```bash
# Non-interactive
lt fullstack init --name <Name> --frontend <angular|nuxt> --git <true|false> --noConfirm \
[--git-link <URL>] [--api-link <path>] [--frontend-link <path>]
[--git-link <URL>] [--api-link <path>] [--frontend-link <path>] [--next]
```

| Parameter | Required | Description |
Expand All @@ -68,14 +69,15 @@ lt fullstack init --name <Name> --frontend <angular|nuxt> --git <true|false> --n
| `--frontend-branch` | No | Branch of frontend starter |
| `--api-copy` / `--api-link` | No | Local API template (copy / symlink) |
| `--frontend-copy` / `--frontend-link` | No | Local frontend template (copy / symlink) |
| `--next` | No | **Experimental** — clone [`nest-base`](https://github.com/lenneTech/nest-base) (Bun + Prisma 7 + Postgres + Better-Auth) for the API. Forces `apiMode = Rest`, `frameworkMode = npm`, and skips the workspace install (run `pnpm install` for app and `bun install` for api manually). Downstream `lt server module/object/addProp/test` are NOT compatible with the resulting layout. |

**Priority:** `--*-link` > `--*-copy` > `--*-branch` > default (GitHub clone)

**Created structure:**
```
<workspace>/
├── projects/
│ ├── api/ ← nest-server-starter
│ ├── api/ ← nest-server-starter (or nest-base with --next)
│ └── app/ ← nuxt-base-starter (or ng-base-starter)
├── package.json
└── .gitignore
Expand All @@ -86,15 +88,19 @@ lt fullstack init --name <Name> --frontend <angular|nuxt> --git <true|false> --n
cd <workspace> && pnpm install
cd projects/api && pnpm start # Port 3000
cd projects/app && pnpm start # Port 3001

# With --next: install per subproject, no workspace install
cd <workspace>/projects/app && pnpm install
cd <workspace>/projects/api && bun install
```

### lt server create — Scaffold New Server

```bash
lt server create <name> --noConfirm [--branch <branch>] [--copy <path>] [--link <path>]
lt server create <name> --noConfirm [--branch <branch>] [--copy <path>] [--link <path>] [--next]
```

Creates a standalone NestJS project from nest-server-starter. For module/object/property commands, see `generating-nest-servers` skill.
Creates a standalone NestJS project from nest-server-starter. With `--next`, clones [`nest-base`](https://github.com/lenneTech/nest-base) (Bun + Prisma 7 + Postgres + Better-Auth) instead and skips API-mode / vendor-mode / install / `lt.config.json` processing. For module/object/property commands, see `generating-nest-servers` skill — those are NOT compatible with `--next` projects.

## Best Practices

Expand Down
60 changes: 57 additions & 3 deletions plugins/lt-dev/skills/using-lt-cli/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,61 @@ lt fullstack init --name TestApp --frontend nuxt --git false \

---

### 4. Project Types (Examples)
### 4. Experimental: `--next` (nest-base)

`--next` is an experimental flag that swaps the API template from
[`nest-server-starter`](https://github.com/lenneTech/nest-server-starter)
(MongoDB) to [`nest-base`](https://github.com/lenneTech/nest-base)
(Bun + Prisma 7 + Postgres + Better-Auth).

#### Standalone API
```bash
lt server create my-next-api --description "Experimental nest-base API" \
--author "Pascal" --next --noConfirm
```

**What happens:**
1. Clones `https://github.com/lenneTech/nest-base.git` into `./my-next-api/`
2. Patches `package.json` (name/description/version) — universal fields only
3. Skips API mode / vendor mode / install / `lt.config.json` (incompatible)

**Next steps (printed by the CLI):**
```bash
cd my-next-api
bun install
# Configure .env (see .env.example) and start Postgres
bun run dev
```

#### Fullstack Workspace (nuxt + nest-base)
```bash
lt fullstack init --name MyNextApp --frontend nuxt --next --noConfirm
```

**What happens:**
1. Clones `lt-monorepo` workspace
2. Sets up Nuxt frontend in `projects/app/`
3. Clones `nest-base` into `projects/api/` (instead of `nest-server-starter`)
4. Skips workspace install — install per subproject manually

**Next steps:**
```bash
cd MyNextApp
cd projects/app && pnpm install
cd ../api && bun install
# Configure projects/api/.env, start Postgres, run prisma generate / migrate
```

**Limitations of `--next`:**
- `lt server module / object / addProp / test / permissions` target the
classic nest-server layout (Mongoose, `src/server/modules/`) and will
not work on the resulting `nest-base` project.
- Vendor mode is forced off — `--framework-mode vendor` is ignored.
- API mode is forced to `Rest` — `--api-mode GraphQL/Both` is ignored.
- Use for greenfield prototyping; for production builds prefer the
default template.

### 5. Project Types (Examples)

#### Client Project (Angular + NestJS)
```bash
Expand Down Expand Up @@ -390,7 +444,7 @@ lt fullstack init \

---

### 5. Post-Creation Workflows
### 6. Post-Creation Workflows

#### After Angular Fullstack Init
```bash
Expand Down Expand Up @@ -433,7 +487,7 @@ pnpm run dev

---

### 6. Common Initialization Patterns
### 7. Common Initialization Patterns

#### Team Project Setup
```bash
Expand Down
36 changes: 36 additions & 0 deletions plugins/lt-dev/skills/using-lt-cli/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,42 @@ lt fullstack init --name MyApp --frontend angular --git true --noConfirm \
--frontend-copy <path/to/ng-base-starter>
```

## lt server create / lt fullstack init — `--next` (experimental)

`--next` swaps the API template from
[`nest-server-starter`](https://github.com/lenneTech/nest-server-starter)
(MongoDB) to [`nest-base`](https://github.com/lenneTech/nest-base)
(Bun + Prisma 7 + Postgres + Better-Auth).

```bash
# Standalone API
lt server create my-next-api --description "x" --author "y" --next --noConfirm

# Fullstack
lt fullstack init --name MyNextApp --frontend nuxt --next --noConfirm
```

**Effects when `--next` is set:**
- Clones `https://github.com/lenneTech/nest-base.git` instead of `nest-server-starter`.
- Forces `apiMode = Rest` and `frameworkMode = npm`.
- Skips nest-server-starter-specific patching (`config.env.ts`,
`main.ts` Swagger, `meta.json`, README EJS template, `lt.config.json`,
CLAUDE.md API mode).
- Skips vendor-mode transformation.
- Skips workspace install in fullstack mode (Bun ≠ pnpm).

**Limitations:**
- `lt server module / object / addProp / test / permissions` are NOT
compatible with the `nest-base` layout.
- Use for greenfield prototyping; production work should still use the
default template.

**Post-creation install (fullstack):**
```bash
cd <workspace>/projects/app && pnpm install
cd <workspace>/projects/api && bun install
```

## Troubleshooting

### Git
Expand Down