SCRIPE CLI Tooling
Massive productivity with 66 scaffolding templates, multi-database commands, and deep auto-wiring.
The SCRIPE CLI is a production-quality node-based scaffolding tool strictly engineered for the SCRIPE modular monolith. It generates full-stack modules and CRUD features across the .NET backend and Next.js frontend, executing autonomous, surgical wiring connecting Solutions, Configurations, DI containers, Docker services, and permission constants.
Core Scaffolding Commands
There are vast arrays of CLI commands. At the heart are two fundamental scaffolders that deeply integrate all baseline requirements.
Module Scaffolding: new-module
Creates a complete, strongly-typed architecture pattern. It generates a 3-project DDD backend structure (Domain, Application, Infrastructure) and a unified frontend module directory.
$ scripe new-module <name> [options]
# Options:
# --backend-only Generate only the backend module
# --frontend-only Generate only the frontend module
# --entity <name> Custom name for the first entity
# --with-no-entity Create bare skeleton without initial CRUD entity
# --no-cache Skip Redis cache integration on queries/commands
# --no-cleaner-bg-service Skip soft-delete cleanup background job generationsrc/modules/{kebab-name}/
├── di.ts # DI container (wires all sub-modules)
├── index.ts # Public API barrel file
└── {sub-module}/ # Sub-module named folder (e.g., {kebab-name})
├── index.ts # Sub-module barrel
├── locales/ # Sub-module-owned translations
│ ├── {sub-module}.en.ts
│ ├── {sub-module}.ar.ts
│ └── index.ts
└── src/
├── domain/
│ ├── entities/{Entity}.ts # Zod schema entity
│ └── interfaces/
│ ├── I{Entity}Repository.ts
│ └── I{Entity}Service.ts
├── data/
│ ├── models/{Entity}Model.ts
│ ├── mappers/{Entity}Mapper.ts
│ └── repositories/{Entity}Repository.ts
└── presentation/
├── viewmodels/use{Entity}ViewModel.ts
└── views/{Entity}ListView.tsxFeature Scaffolding: new-feature
Generates expansive CRUD patterns. Employs an exact property DSL to weave out 26 distinct files across REST Controllers, CQRS SCRIPE mediator, Solid Rect Components, TanStack Query models, and EF Core configurations.
$ scripe new-feature <module> <entity> -p <properties> [options]
# Options:
# -p, --properties <props> (Required) Property definitions string
# --backend-only Generate only backend files
# --frontend-only Generate only frontend files
# --no-controller Skip REST controller generation
# --no-cache Skip cache integration
# --no-cleaner-bg-service Skip adding entity to soft-delete cleanup job
# Example: E-commerce Invoice
$ scripe new-feature Products Invoice \
-p "Title:string:required:max(200),Amount:decimal:required:min(0),Status:enum(Draft|Sent|Paid):required"Destructive Tools
Because the CLI wires deeply into the core fabric of SCRIPE, it provides powerful destruction operations to execute perfect code rollback when testing layouts rapidly.
# Remove a full module and aggressively rollback ALL auto-wiring safely
$ scripe remove-module Products --confirm
# Remove a specific feature/entity and rollback its DI and permissions
$ scripe remove-feature Products Invoice --confirm
# Auto-detect the most recent scaffolding and obliterate it
$ scripe remove-module --last --confirmBackground Service Operations
Immediately hook a module into the background job engine using standalone initialization tooling.
# Automatically generate and wire a Hangfire Soft-Delete Cleanup Job
$ scripe add-bg-service Products
$ scripe remove-bg-service ProductsProperty DSL Syntax
The `--properties` (`-p`) parameter allows highly flexible Domain-Specific definitions mapped universally backwards and forwards across C# to TypeScript Types, culminating in SQL structures and validated Zod schemas.
| C# Type | TypeScript | Zod Schema | Form Input |
|---|---|---|---|
| string | string | z.string() | text |
| int | number | z.number().int() | number |
| decimal | number | z.number() | number |
| bool | boolean | z.boolean() | switch |
| datetime | Date | z.coerce.date() | date |
| guid | string | z.string().uuid() | text |
| Modifier / Special Type | Effect | Example Usage |
|---|---|---|
| Foreign Key (FK) | Generates Guid mapping + selects UI | ClientId:FK:Client:required |
| Enum | Generates C# enum + TS Union | Status:enum(Draft|Paid):required:default(Draft) |
| maxLength(N) | Maximum string length constraint | Code:string:maxLength(10) |
| Email validation | Email:string:required:email | |
| Type[] | Generates Arrays | Tags:string[]? |
66 Immutable Templates
Instead of writing standard architectures by hand, the CLI enforces pure Clean Architecture through 66 precise Handlebars templates spanning 46 backend files and 20 frontend configurations, locking down quality.
| Backend Templates (46 Files) | Purpose |
|---|---|
| Entity.cs.hbs | Domain Object Base Class |
| EntityCommands.cs.hbs | AstraFlow mediator Create/Update/Delete Records |
| CreateEntityCommandHandler.cs.hbs | Create specific handler |
| EntityQueries.cs.hbs | AstraFlow mediator Query Records |
| GetEntitiesQueryHandler.cs.hbs | List Handler |
| EntityController.cs.hbs | REST API Controller |
| DbContext.cs.hbs | Full Database EF Core Context |
| ApplicationDI.cs.hbs / InfrastructureDI.cs.hbs | Dependency Injection Layers |
| en.json.hbs / ar.json.hbs | Localization dictionaries |
| Frontend Templates (20 Files) | Purpose |
|---|---|
| di.ts.hbs | Frontend Module DI Container |
| page.tsx.hbs | Next.js App Router Page wrapper |
| Entity.ts.hbs | Comprehensive Zod Entity Schema |
| EntityModel.ts.hbs | API DTO Typings |
| EntityMapper.ts.hbs | DTO ↔ Entity mapper logic |
| useEntityViewModel.ts.hbs | TanStack React Query controller payload |
| EntityListView.tsx.hbs | SOLID-compliant Pure UI React Component |
Automated Defense in Depth
When generating REST API Controllers from the CLI, highly constrained security attributes are immediately bound directly onto the generated endpoints by default.
| Security Feature | Attribute / Tool | Effect |
|---|---|---|
| Authorization | [Authorize] | Force JWT Bearer on endpoints |
| Rate Limiting | [EnableRateLimiting("per-user")] | Sliding window 100 req/min limit |
| Role Guards | [AdminOnly] | Controller level route protection |
| Granular Permissions | [PermissionRequired("...")] | Claim/Policy checks per-endpoint |
| Query Limits | Math.Min(pageSize, 100) | Guards against memory exhaustion queries |
Profound Auto-Wiring
Generating code is trivial; safely embedding that code into a massive compiled ecosystem is the true engineering victory. The CLI performs autonomous modifications to all critical junctions including:
- .sln injection (Guids and explicit pathways mapped across solution structures).
- Program.cs (Host registrations).
- appsettings.json (Database scaling connection string integrations).
- docker-compose.yml (Injects gateway microservices references).
- permissions.ts (Next.js client-bound RBAC constant mapping arrays).
- src/app/ (Next.js server-routing injection).
- .env variables mapping proxy configurations cleanly.
Database & API Synchronization
High tier commands handle parallel database architectures and frontend proxies seamlessly, closing the infrastructure loop entirely.
- Intelligently executes `add-migration`, `update`, and `remove-migration` against SqlServer, Oracle, and PostgreSQL — either all providers simultaneously or a specific one with the `-p` flag.
- Consumes a remote Swagger/OpenAPI endpoint, parsing into pixel-perfect TypeScript Zod schemas, React controllers, and structured models instantly.
# Generate migration for all 3 providers (SqlServer, Oracle, PostgreSql)
$ scripe db add-migration Initial -m CRM
# Generate migration for a specific provider only
$ scripe db add-migration Initial -m CRM -p SqlServer
# Apply migrations (auto-detects provider from appsettings.json)
$ scripe db update -m CRM
# Override provider for update
$ scripe db update -m CRM -p Oracle
# Remove last migration from all 3 providers
$ scripe db remove-migration -m CRM
# Remove last migration from a specific provider only
$ scripe db remove-migration -m CRM -p SqlServer
# Rebuild frontend schemas to mirror live Backend structure
$ scripe sync-api https://localhost:5035/swagger/v1/swagger.json -m crmCLI Project Configuration Mapping
The SCRIPE CLI parses `scripe.config.json` files walking rapidly up the filesystem to construct its universal path configurations binding to your mono-repo.
{
"backend": {
"root": "./SCRIPE-Backend",
"solutionFile": "SCRIPE-Backend.sln",
"modulesDir": "src/Modules",
"hostDir": "src/Host/API",
"coreDir": "src/Core"
},
"frontend": {
"root": "./SCRIPE-Frontend",
"modulesDir": "src/modules",
"appDir": "src/app",
"coreDir": "src/core",
"localesDir": "src/core/locales"
},
"defaults": {
"targetFramework": "net10.0",
"languages": ["en", "ar"]
}
}Intelligent Naming Mutations
Provide a singular PascalCase entity name and the CLI generates infinite pluralized, kebab-cased, and CONSTANT_MAPPED variations flawlessly across the stack.
| Variant | Example (InvoiceItem) | Usage |
|---|---|---|
| name | InvoiceItem | C# classes, PascalCase structures |
| namePlural | InvoiceItems | Collections, API Controllers |
| camelName | invoiceItem | TypeScript endpoints/variables |
| camelNamePlural | invoiceItems | React Query models |
| kebabName | invoice-item | File names, URLs |
| kebabNamePlural | invoice-items | Browser Route paths |
| snakeName | invoice_item | Database columns |
| snakeNamePlural | invoice_items | Database tables |
| upperSnakeName | INVOICE_ITEM | Environment variables, constants |
Ecosystem Utility Tools
Control build pipelines, package installations, and live development servers spanning across Node.js and .NET instantly from a unified prompt.
# Fast installation trees targeting specific ecosystems
$ scripe install all # Both CLI and Frontend via npm/pnpm
$ scripe install frontend # Only Frontend
# Fast compilation targets
$ scripe build all # Typescript CLI -> dotnet build -> pnpm build
$ scripe build backend # dotnet build
# Local Server Proxies
$ scripe dev frontend # Next.js Server
$ scripe dev backend # Kestrel .NET Engine