Scaffoldrite

Command Reference & Positional Arguments

This page documents all Scaffoldrite commands, their positional arguments, and usage patterns.


1. Argument Processing Rules

Before any command is executed:

  1. Flags are removed first
    All --flag or -f options are extracted and do NOT count as positional arguments.

  2. Remaining inputs are positional
    Their meaning depends entirely on the command and position.


2. Command Table (Positional Reference)

CommandPos 1Pos 2Pos 3Pos 4Notes
initCommandDirectory (--from-fs)Initializes structure
updateCommandDirectory (--from-fs)Updates from filesystem
mergeCommandDirectory (--from-fs)Merges folder structure
listCommandLists structure or filesystem
createCommandPathfile or folderCreates file/folder
deleteCommandPathDeletes file/folder
renameCommandOld pathNew path/nameRenames file/folder
generateCommandOutput directoryGenerates structure
validateCommandValidates filesystem vs structure
findCommandSearch queryFinds file/folder
versionCommandShows version
lockCommandApplies project restrictions
unlockCommandRemoves project restrictions
depsCommandAnalyzes project dependencies

3. Usage Examples

Initialize from filesystem

sr init --from-fs ./src
# Pos 3: ./src

Create a file

sr create src/components/Button.ts file --yes
# Pos 2: src/components/Button.ts
# Pos 3: file

Rename a file

sr rename src/oldfile.txt src/newfile.txt --yes
# Pos 2: oldfile.txt
# Pos 3: newfile.txt

Generate structure

sr generate .
# Pos 2: .

Find a component

sr find Button
# Pos 2: Button

Lock project rules

sr lock --git
# Positional args: none (flag-driven command)

Unlock project rules

sr unlock --structure
# Positional args: none (flag-driven command)

Analyze dependencies

sr deps --fs
# Positional args: none (analysis mode via flags)

4. Best Practices

  • Always provide required positional arguments first.
  • Use . as a safe default output directory.
  • Use --dry-run to preview changes before execution.
  • Check the command table before assuming argument meaning.
  • Flags can be combined in any order and are ignored in positional parsing.
  • Commands like lock, unlock, and deps are flag-driven only (no positional inputs).

On this page