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.

New Module CommandShell
$ 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 generation
Generated Frontend Module StructureTypeScript
src/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.tsx

Feature 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.

New Feature CommandShell
$ 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.

Destructive CommandsShell
# 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 --confirm

Background Service Operations

Immediately hook a module into the background job engine using standalone initialization tooling.

Background Job ToolingShell
# Automatically generate and wire a Hangfire Soft-Delete Cleanup Job
$ scripe add-bg-service Products

$ scripe remove-bg-service Products

Property 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# TypeTypeScriptZod SchemaForm Input
stringstringz.string()text
intnumberz.number().int()number
decimalnumberz.number()number
boolbooleanz.boolean()switch
datetimeDatez.coerce.date()date
guidstringz.string().uuid()text
Modifier / Special TypeEffectExample Usage
Foreign Key (FK)Generates Guid mapping + selects UIClientId:FK:Client:required
EnumGenerates C# enum + TS UnionStatus:enum(Draft|Paid):required:default(Draft)
maxLength(N)Maximum string length constraintCode:string:maxLength(10)
emailEmail validationEmail:string:required:email
Type[]Generates ArraysTags: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.hbsDomain Object Base Class
EntityCommands.cs.hbsAstraFlow mediator Create/Update/Delete Records
CreateEntityCommandHandler.cs.hbsCreate specific handler
EntityQueries.cs.hbsAstraFlow mediator Query Records
GetEntitiesQueryHandler.cs.hbsList Handler
EntityController.cs.hbsREST API Controller
DbContext.cs.hbsFull Database EF Core Context
ApplicationDI.cs.hbs / InfrastructureDI.cs.hbsDependency Injection Layers
en.json.hbs / ar.json.hbsLocalization dictionaries
Frontend Templates (20 Files)Purpose
di.ts.hbsFrontend Module DI Container
page.tsx.hbsNext.js App Router Page wrapper
Entity.ts.hbsComprehensive Zod Entity Schema
EntityModel.ts.hbsAPI DTO Typings
EntityMapper.ts.hbsDTO ↔ Entity mapper logic
useEntityViewModel.ts.hbsTanStack React Query controller payload
EntityListView.tsx.hbsSOLID-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 FeatureAttribute / ToolEffect
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 LimitsMath.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.
Database Migration CommandsShell
# 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 crm

CLI 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.

scripe.config.jsonJSON
{
  "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.

VariantExample (InvoiceItem)Usage
nameInvoiceItemC# classes, PascalCase structures
namePluralInvoiceItemsCollections, API Controllers
camelNameinvoiceItemTypeScript endpoints/variables
camelNamePluralinvoiceItemsReact Query models
kebabNameinvoice-itemFile names, URLs
kebabNamePluralinvoice-itemsBrowser Route paths
snakeNameinvoice_itemDatabase columns
snakeNamePluralinvoice_itemsDatabase tables
upperSnakeNameINVOICE_ITEMEnvironment 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.

Utility Build TreesShell
# 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