Skip to content

Emin-ACIKGOZ/scbake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

140 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Scaffold Bake: The Atomic Project Scaffolder

scbake is a single-binary CLI tool that simplifies project setup and maintenance by applying layered infrastructure templates and language packs atomically. It uses a manifest file (scbake.toml) as the source of truth for configuration, ensuring consistency and reproducibility.

✨ Core Philosophy: Layering, Safety, and Extensibility

scbake provides a safe, composable, and customizable way to manage project infrastructure.

  • Atomic Layering and Composition
    Projects are built by applying independent layers (language packs and tooling templates). You can mix and match templates to achieve the desired setup.

  • Highly Configurable & Extensible
    Designed for flexibility. If a language pack is missing, simply add it. If a template doesn’t fit, you can modify or replace it. The handler interface simplifies extension.

  • Built-in Atomic Safety
    All modifications are managed by a LIFO-based Transaction Manager. If any task fails, the engine executes a journaled rollback. This deletes created artifacts and restores file backups in reverse order, ensuring the filesystem returns to its original state.

  • Prioritized Execution
    Tasks run in a defined order using Priority Bands (e.g., directory creation → language setup → universal config) to ensure dependencies are met.

🚀 Installation

scbake is currently in alpha development. There is no fixed method for installation or distribution beyond compiling from source at this stage.

Build from Source

To compile the binary yourself, ensure you have Go 1.21+ installed:

1. Clone the repository:

git clone https://github.com/Emin-ACIKGOZ/scbake.git

2. Build the project:

go build -o scbake main.go

3. Move the binary to your path (optional):

mv scbake /usr/local/bin/

📋 Commands & Usage

new: Create a New Project

Creates a new directory, bootstraps the scbake.toml manifest, and applies language packs and templates.

Note: Git initialization can be added via the --with git template.

scbake new <project-name> [--lang <lang>] [--with <template...>]
Flag Description Example
--lang Primary language pack (go, svelte, spring) --lang go
--with Comma-separated tooling templates --with makefile,ci_github

Example:

scbake new my-backend --lang go --with makefile,ci_github

apply: Apply Templates to an Existing Project

Applies new language packs or tooling templates to an existing path. Because scbake uses its own transaction logic, it does not require a clean Git tree to operate safely.

scbake apply [--lang <lang>] [--with <template...>] [<path>]
Argument Description Default
<path> Target directory .

Example:

scbake apply --with maven_linter

list: View Available Resources

Lists available or applied resources.

scbake list [langs|templates|projects]

🌐 Supported Language Packs

Language Initialization Tasks Required Binaries
Go Creates .gitignore, main.go; runs go mod init, go mod tidy go
Svelte Runs npm create vite@latest, installs dependencies, sets NPM scripts npm
Spring Downloads starter zip from start.spring.io, extracts, makes mvnw executable curl, unzip, java

🛠️ Tooling Templates

Template Priority Band Features
editorconfig Universal Config (1000) Standard file formatting across the project
ci_github CI (1100) Conditional CI setup based on detected languages
go_linter Linter (1200) Standard golangci-lint configuration
maven_linter Linter (1200) Sets up Maven Checkstyle
svelte_linter Linter (1200) ESLint 9 integration for Svelte projects
makefile Build System (1400) Universal build/lint scripts for all projects
devcontainer Dev Env (1500) Containerized DX with auto-detected toolchains
git Version Control (2000) Initializes repo, stages all files, and creates initial commit

💻 Extending scbake

  1. Create a new package under pkg/lang or pkg/templates.
  2. Implement the Handler interface using task types (CreateTemplateTask, ExecCommandTask, etc.).
  3. Register the handler in the relevant registry.go.

⚙️ Development Details

Task Execution Priority

Band Name Range Purpose
PrioDirCreate 50–99 Directory creation
PrioLangSetup 100–999 Language setup
PrioConfigUniversal 1000–1099 Universal config
PrioCI 1100–1199 CI workflows
PrioLinter 1200–1399 Linter setup
PrioBuildSystem 1400–1499 Build systems
PrioDevEnv 1500-1999 Dev environment setup
PrioVersionControl 2000-2100 VCS initialization (Git)

Global Flags

Flag Description
--dry-run Show planned changes without applying them
--force Override safety checks
-v, --version Show version (v0.0.1-dev)

About

Scaffold Bake is a single-binary CLI that atomically scaffolds and maintains projects using composable language packs and infrastructure templates from a single source of truth.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors