Scaffoldrite

Daily Workflows


Scaffoldrite streamlines your day-to-day project management. This guide shows common workflows from initialization to validation, generation, and modification.


1. Initialize & Setup

CommandWhat It DoesWhen To Use
sr initCreates a starter structure.srStarting a new project
sr init --emptyCreates minimal structure with only constraintsWhen you want full control
sr init --from-fs <directory>Generates structure.sr from an existing projectAdopting Scaffoldrite in an existing codebase
sr update --from-fs <directory>Updates structure.sr from filesystemSync structure after manual changes
sr merge --from-fs <directory>Merges folder structure into current structure.srCombine multiple layouts
sr init --forceOverwrites existing configStarting fresh
# Generate to current directory
sr generate .

# Generate to a specific directory
sr generate ./output

# Init from current directory
sr init --from-fs .

# Update from specific directory
sr update --from-fs ./components

⚠️ Always provide a directory for commands that require it (generate, update, merge, init --from-fs).


2. Validate & Check

CommandWhat It DoesWhen To Use
sr validateChecks if filesystem matches structure.srBefore commits or CI/CD
sr validate --allow-extraAllows extra files not in structureDuring migration or partial adoption
sr validate --allow-extra <paths...>Allows specific extra filesWhen some files are intentionally outside structure
# Strict check
sr validate

# Migration phase
sr validate --allow-extra

# Only allow certain extras
sr validate --allow-extra README.md .env.example

3. Generate & Create

CommandWhat It DoesWhen To Use
sr generate <directory>Creates entire structureInitial setup or reset
sr generate ./outputGenerates to specific directoryCreating templates for others
sr generate . --yesSkips confirmation promptsAutomation scripts
sr generate . --dry-runPreviews what would happenReview before applying
sr generate ./output --copyCopies structure and file contentsCreating complete project templates
# Create structure in current directory
sr generate .

# Copy structure AND contents to output
sr generate ./project-template --copy

# Preview before copying
sr generate ./dist --copy --dry-run

4. Modify & Evolve

CommandWhat It DoesWhen To Use
sr create <path> folderAdds folderAdding new feature areas
sr create <path> fileAdds fileCreating new modules
sr delete <path>Removes from structureCleaning up tech debt
sr rename <old> <new>Renames in structureRefactoring
sr update --from-fs .Syncs structure.sr from current filesAfter manual tweaks
sr merge --from-fs ./new-featuresMerges new files into structure.srCollaborative feature adds
# Add a utils folder
sr create src/utils folder

# Rename to helpers
sr rename src/utils src/helpers

# Add a utility file
sr create src/helpers/format.ts file

# Remove it
sr delete src/helpers/format.ts

5. Inspect & Understand

CommandWhat It DoesWhen To Use
sr listShows all structure.sr contentsQuick reference
sr list --structureShows structure.sr respecting ignore listQuick reference
sr list --fsShows actual filesystemCheck current state
sr list --diffCompares structure.sr vs filesystemFind discrepancies
sr find <query>Searches files/folders in structure or filesystemLocate specific items
sr versionShows Scaffoldrite versionDebugging or reporting
# Check expected vs actual
sr list

# View actual filesystem
sr list --fs

# Compare structure vs filesystem
sr list --diff

# Find a component
sr find Button

# Search only in structure.sr
sr find Button --sr

# Search only in filesystem
sr find Button --fs

Next up: Constraints

On this page