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:
| Category | Commands | Purpose |
|---|---|---|
| Initialize & Setup | init, update, merge | Create or sync your structure.sr with your filesystem |
| Generate & Create | generate, create | Generate entire structure or add files/folders |
| Modify & Evolve | rename, delete | Rename or remove items from the structure |
| Inspect & Understand | list, find, version | View your structure, search for items, check Scaffoldrite version |
| Validation | validate | Ensure 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
--helpfor command-specific guidance:
sr init --help3. Examples
Initialize a new project
sr initGenerate structure in the current directory
sr generate .Create a new folder
sr create src/components folderRename a file
sr rename src/index.ts main.tsDelete a folder
sr delete src/tempList your structure
sr list --structure
sr list --fs
sr list --diffFind a specific file or folder
sr find Button
sr find Button --sr # search only structure.sr
sr find Button --fs # search only filesystem4. Best Practices
- Place flags after positional arguments for clarity.
- Flag order does not matter.
- Always provide the output directory when using
generateto prevent accidental overwrites. - Use
--dry-runto preview actions without modifying files.
Next up: Command Reference