Scaffoldrite

Commands


Scaffoldrite gives you full control over your project structure with a consistent set of commands. These commands let you initialize, generate, validate, modify, and inspect your project layout.


1. Command Categories

Scaffoldrite commands are organized by purpose:

CategoryCommandsPurpose
Initialize & Setupinit, update, mergeCreate or sync your structure.sr with your filesystem
Generate & Creategenerate, createGenerate entire structure or add files/folders
Modify & Evolverename, deleteRename or remove items from the structure
Inspect & Understandlist, find, versionView your structure, search for items, check Scaffoldrite version
ValidationvalidateEnsure the filesystem matches your structure.sr constraints

2. Command Syntax

Scaffoldrite uses positional arguments with optional flags:

sr <command> [arg1] [arg2] ... [flags]
  • Positional arguments are interpreted based on command.
  • Flags (--flag, -f) are extracted first and don’t count as positional arguments.
  • Use --help for command-specific guidance:
sr init --help

3. Examples

Initialize a new project

sr init

Generate structure in the current directory

sr generate .

Create a new folder

sr create src/components folder

Rename a file

sr rename src/index.ts main.ts

Delete a folder

sr delete src/temp

List your structure

sr list --structure
sr list --fs
sr list --diff

Find a specific file or folder

sr find Button
sr find Button --sr   # search only structure.sr
sr find Button --fs   # search only filesystem

4. Best Practices

  • Place flags after positional arguments for clarity.
  • Flag order does not matter.
  • Always provide the output directory when using generate to prevent accidental overwrites.
  • Use --dry-run to preview actions without modifying files.

Next up: Command Reference

On this page