loor-cli
v0.1.11
Published
CLI scaffolding tool for loor monorepo projects
Downloads
849
Readme
loor CLI
CLI scaffolding tool for loor monorepo projects.
Installation
npm install -g loor-cli
# or
pnpm add -g loor-cliCommands
loor init [name]
Create a new loor monorepo project.
loor init my-projectArguments
| Argument | Required | Description |
|----------|----------|-------------|
| name | No | Project name. If omitted, prompted interactively. |
Options
| Option | Description | Example |
|--------|-------------|---------|
| --apps <apps> | App types with optional names (comma-separated). Format: type or type:name. | --apps api:backend,web-client:dashboard |
| --packages <packages> | Optional packages to include (comma-separated). | --packages mediaKit,notification |
| --no-packages | Skip optional packages. Only required packages are installed. | |
Usage Examples
Fully interactive (prompts for everything):
loor initNon-interactive (no prompts):
loor init my-saas \
--apps api:backend,web-client:dashboard \
--packages mediaKit,notificationPartial — only skip app selection:
loor init my-saas --apps api,web-client
# App names default to "api" and "admin"
# Packages will be prompted interactivelyPartial — only skip package selection:
loor init my-saas --no-packages
# App types and names will be prompted interactively
# No optional packages installed (only required ones)Custom app names:
loor init my-saas --apps api:my-api,web-client:admin,web-client:portalApp Types
| Type | Description | Default Name |
|------|-------------|--------------|
| api | Express.js + MongoDB REST API server | api |
| web-client | React + Vite admin panel / frontend | admin |
Multiple apps of the same type are allowed (e.g., two web-client apps with different names).
Required Packages
These packages are always installed based on selected app types — they cannot be deselected:
API apps: auth, base, expressRouteKit, logger, eslintConfig, typescriptConfig
Web Client apps: auth, base, storage, ui, i18n, routerProvider, commandMenu, apiClient, eslintConfig, typescriptConfig
What It Does
- Creates project directory with root config files (
turbo.json,pnpm-workspace.yaml,tsconfig.json, etc.) - Generates
package.jsonprogrammatically - Copies selected app templates from the reference apps
- Copies all packages, then removes artifacts of unselected packages (subtractive approach)
- Resolves transitive package dependencies automatically
- Replaces
@loor/scope with@<projectName>/across the project
loor add app <type> [name]
Add a new app to an existing project.
loor add app api backend
loor add app web-client dashboardArguments
| Argument | Required | Description |
|----------|----------|-------------|
| type | Yes | App type: api or web-client |
| name | No | App name. Defaults to api for API, admin for web-client. |
What It Does
- Copies reference app template to
apps/<name>/ - Installs required packages for the app type (if missing)
- Removes artifacts of non-installed packages from the new app
loor add package <name>
Add a package to an existing project.
loor add package mediaKit
loor add package notificationArguments
| Argument | Required | Description |
|----------|----------|-------------|
| name | Yes | Package name from the registry |
What It Does
- Resolves transitive dependencies automatically
- Copies package source to
packages/<name>/ - Generates infra adapters in API apps (
src/infra/) - Generates client setup files in client apps
- Adds env vars to
.env.example - Merges npm dependencies into app
package.jsonfiles - Injects config annotation blocks
loor list
List all available packages with their descriptions, categories, and compatibility.
loor listPackages are organized by category: core, server, client, config.
loor update
Force-refresh the package registry from the remote source.
loor updateThe registry is cached locally (~/.loor/registry/) with a 24-hour TTL. This command forces a re-download.
loor config
Configure the CLI registry source (local development or remote production).
# Show current config
loor config
# Use local repo as source (for CLI development)
loor config --local
loor config --local /path/to/loor
# Switch back to remote
loor config --remoteOptions
| Option | Description |
|--------|-------------|
| --local [path] | Use a local repo as scaffold source. Defaults to current directory. |
| --remote | Use the remote GitHub registry (production). |
The LOOR_LOCAL environment variable overrides any persisted config.
loor ai init
Generate AI context files for the project.
loor ai initWhat It Does
- Generates
CLAUDE.mdwith project-specific context (apps, packages, conventions, routes, infra) - Generates
.mcp.jsonto register the loor MCP server
Global Options
| Option | Description |
|--------|-------------|
| --debug | Enable debug mode with detailed error output |
| --version | Show CLI version |
| --help | Show help for any command |
loor --debug init my-project
loor init --help
loor add app --helpMCP Server
The CLI includes a built-in MCP (Model Context Protocol) server for AI integrations.
loor --mcpThis starts a stdio-based MCP server that exposes the following tools:
| Tool | Description |
|------|-------------|
| list_packages | List available packages with optional category/compatibility filters |
| get_package_guide | Get detailed guide for a specific package (patterns, infra, env vars) |
| get_conventions | Get project conventions (architecture, routes, features) |
| how_to | Step-by-step guides for common tasks |
| cli_usage | Complete CLI command reference and usage examples |
The MCP server is auto-registered via loor ai init.
Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| LOOR_LOCAL | Path to local loor repo (overrides config) | — |
| LOOR_REPO | GitHub repository | ismailyagci/turbo-base |
| LOOR_BRANCH | Git branch to use | master |
Workflow Examples
Create a full-stack project (interactive)
loor init my-app
# Select: api + web-client
# Name api: api
# Name web-client: admin
# Select packages: mediaKit, notification
cd my-app && pnpm install && pnpm devCreate a full-stack project (non-interactive / CI)
loor init my-app \
--apps api,web-client:admin \
--packages mediaKit,notification
cd my-app && pnpm install && pnpm devAdd a second frontend to an existing project
cd my-app
loor add app web-client portal
pnpm installAdd a package to an existing project
cd my-app
loor add package mediaKit
pnpm installSet up AI tooling
cd my-app
loor ai init
# CLAUDE.md and .mcp.json are generated