Scaffo is a CLI tool designed to streamline the creation of new Go projects by scaffolding from existing codebases. It automatically detects the source project's name and recursively replaces it with the new project's name across file paths, contents, and various casing styles.
Key Features:
Zero Config Start: Begin by pointing Scaffo at an existing folder.
Smart Replacement: Automatically identifies and replaces the source project name (e.g., MyOldProject to NewApp).
Case Preservation: Handles variations like myOldProject -> newApp, MY_OLD_PROJECT -> NEW_APP, etc.
Interactive Mode: Features a user-friendly terminal UI for selecting source folders.
Configurable: Use scaffold.config.json to ignore specific files or folders.
Audience & Benefit:
Ideal for Go developers seeking to accelerate project setup. Scaffo simplifies the process of creating new projects by automating repetitive tasks, reducing manual effort and errors in renaming and updating files.
Scaffo can be installed via winget on Windows, offering a seamless experience for developers working with existing codebases to quickly scaffold new projects.
README
Scaffo
Scaffo is a powerful yet simple CLI tool for scaffolding new projects from existing local codebases. It automatically detects your source project's name and recursively replaces it with your new project's name—handling file paths, contents, and various casing styles (PascalCase, camelCase, snake_case, kebab-case, etc.).
Features
Zero Config Start: Point it at a folder and go.
Smart Replacement: Automatically detects the source project name (e.g., MyOldProject) and replaces it with the new name (e.g., NewApp) everywhere.
Case Preservation: Handles variations like myOldProject -> newApp, MY_OLD_PROJECT -> NEW_APP, etc.
Interactive Mode: Easy-to-use terminal UI to select source folders.
Configurable: Use scaffold.config.json to ignore specific files or folders.
Installation
Homebrew (macOS/Linux)
brew install razpinator/tap/scaffo
Winget (Windows)
winget install razpinator.scaffo
From Source
go install github.com/razpinator/scaffo@latest
Or clone and build:
git clone https://github.com/razpinator/scaffo.git
cd scaffo
go build -o scaffo cmd/main.go
Usage
Interactive Mode
Simply run scaffo without arguments to launch the interactive UI:
scaffo
Select Run to choose a source folder from your current directory or enter a custom path.
CLI Commands
Initialize Configuration
Create a default scaffold.config.json for a source project:
scaffo init --from /path/to/source-project
Run Scaffolding
Scaffold a new project directly:
scaffo run --from /path/to/source-project --out ./my-new-project
This will:
Copy files from /path/to/source-project to ./my-new-project.
Rename files and directories matching the source project name.