scaff 1.0.3

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet tool install --global scaff --version 1.0.3
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local scaff --version 1.0.3
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=scaff&version=1.0.3
                    
nuke :add-package scaff --version 1.0.3
                    

Scaffer CLI

Universal cross-language scaffolding generator — simple, fast, and framework-agnostic.


✨ What is Scaffer?

Scaffer is a universal scaffolding generator that uses simple .scaff template files
to create files for any language or framework (C#, HTML, JS, React, Python, etc.).

It includes:

  • 🛠 A powerful CLI (scaff)
  • 📦 Simple scaffold templates
  • 🔧 Parameter injection
  • 🧩 Optional parameters with fallback
  • 🚀 Cross-platform support (Windows, Linux, macOS)

Installation

Install globally from NuGet:

dotnet tool install -g Scaffer

Update

dotnet tool update -g Scaffer

Uninstall

dotnet tool uninstall -g Scaffer

Syntax

Define metadata

@Meta(

  Extension: ".html"
  Route: "./"
  Name: "index"
)

Route, and Name are optional values and they can be set in while generating the file with the --scaff-route and --scaff-out respectively. By default ./ is set to the route and a random GUID for the Name.

Define the params


@Params(

  name??
)

Params are by default optional but you can add a fallback to them.

....
 name??Jhon
 ....

Use your params values in the @Template directive

@Template(
 <p>{{value:name}}</p>
)

📦 .scaff file example

MyClassTemplate.scaff


    
@Meta(
    Extension: ".cs"
)

@Params(
    name??ExampleService
    type??string
    initial??"Hello World"
    log??
)

@Template(`
using System;

namespace MyApp.Services
{
    public class {{value:name}}
    {
        public {{value:type}} Data { get; set; } = {{value:initial}};

        public void Log()
        {
            Console.WriteLine({{value:log}});
        }
    }
}
`)

build command

scaff build CSharpHook.scaff 
    --scaff-param name=UserService 
    --scaff-param type=string 
    --scaff-param initial="John Doe"
    --scaff-param log="Data"

The output

using System;

namespace MyApp.Services
{
    public class UserService
    {
        public string Data { get; set; } = "John Doe";
        
        public void Log()
        {
           Console.WriteLine(Data);
        }
    }
}

Show available .scaff files

scaff --scaff-list

Show all commands

scaff --scaff-help
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated