The nfw CLI is the command-line entry point for the NFramework toolchain. It creates workspaces from generators, scaffolds services and modules, generates mediator commands/queries and full CRUD flows, and validates architecture boundaries.
git clone https://github.com/n-framework/n-framework.git
cd n-framework
make build# List available generators
nfw generators list
# Create a new workspace (interactive)
nfw new my-workspace
# Create non-interactively in CI
nfw new my-workspace --generator blank-workspace --no-inputnfw new [name] # Create a new workspace from a generator
nfw new [name] --generator <id> # Create with an explicit generator
nfw new [name] --generator <id> --no-input # Non-interactive (for CI)nfw generators list # List discovered generators
nfw generators add <name> <url> # Register a generator source (git URL)
nfw generators remove <name> # Unregister a generator source
nfw generators refresh # Refresh generator catalogs from sourcesnfw add service <name> # Generate a service from a service generator
nfw add service <name> --generator <id> # Generate with an explicit service generator
nfw add mediator --service <name> # Add the mediator module to a service
nfw add persistence --service <name> # Add the persistence module to a service
nfw add webapi --service <name> # Add the webapi module to a servicenfw gen entity <name> --properties <props> # Generate an entity (schema + files)
nfw gen crud <entity-name> --feature <name> # Generate complete CRUD scaffolding
nfw gen command <name> --feature <name> # Generate a mediator command
nfw gen query <name> --feature <name> # Generate a mediator query
nfw gen endpoint <GET|POST|PUT|DELETE> <name> # Generate a minimal API endpoint mapping
nfw gen repository <name> --feature <name> # Generate a repository for an entitynfw check # Validate workspace architecture boundariesMost generation commands accept --no-input to disable interactive prompts (required for CI).
--properties <list>— Comma-separatedName:Typepairs (e.g.Name:string,Price:decimal?,Active:bool).--id-type <type>— Primary key type (defaultGuid). Supported:int,long,Guid,string.--entity-type <type>— Base type (defaultentity). Options:entity,auditable_entity,soft_deletable_entity.--from-schema <path>— Generate from an existing entity schema YAML file.--schema-only— Only emit the schema YAML; skip generator execution.--service <name>— Target service for the entity.--feature <name>— Target feature within the service.
--feature <name>— Target feature or module.--param <list>— Comma-separated generator parameters (e.g.secured=true,cached=true,no-api=true).--param-json <json>— Generator parameters as a JSON string (e.g.'{"secured": true, "cached": true}').--service <name>— Target service (gen repositoryonly).
Common CRUD parameters: secured=true, cached=true, no-api=true, force=true.
# CRUD with security and caching markers, no API endpoints
nfw gen crud Order --feature Orders --param secured=true,cached=true,no-api=true
# Non-interactive CRUD for CI
nfw gen crud Product --feature Products --no-input| Identifier | Display Name | Description |
|---|---|---|
blank-workspace |
Blank Workspace | Minimal starter workspace |
Run nfw generators list to see all generators discovered from registered sources.
Generators are resolved in this order:
- Local path from
generator_sources.localin the workspacenfw.yaml. ~/.nfw/generators(the primary cache/config directory).~/.cache/nfw/generators(legacy cache fallback).
Use nfw generators add <name> <url> to register a remote source and nfw generators refresh to fetch the latest catalogs.
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Internal error |
| 2 | Validation error |
| 3 | Not found |
| 4 | Conflict |
| 10 | External dependency failure |
| 130 | Interrupted (SIGINT) |
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.