snap-scaffold
v1.0.0
Published
Snapshot your directory structure and restore it anywhere
Maintainers
Readme
snap-scaffold
A CLI to snapshot your directory structure into a plain-text file and restore it anywhere — including from pasted text.
Install
npm install -g snap-scaffoldCommands
snap export
Scans current directory and appends a snapshot block to .snapshot.
Never truncates or deletes previous snapshots.
snap export
snap export -o my-project.snapshot
snap export --ignore dist,build,coveragesnap restore
Recreates the directory/file structure. Never overwrites existing files.
snap restore
snap restore -i my-project.snapshot -d ./new-folder
snap restore --dry-run # preview only
snap restore --text "d src f src/index.js" # restore from pasted textsnap tree
Prints a pretty visual tree of your current directory (or a snapshot).
snap tree
# Output:
my-project/
├── .env
├── apps/
│ └── web/
├── infra/
│ └── docker-compose.yml
└── package.jsonsnap tree -i my-project.snapshot # tree from a saved snapshotSnapshot format
The .snapshot file is plain text:
# snap snapshot
# created: 2025-04-01T10:00:00.000Z
# root: /Users/you/my-project
#
# d = directory f = file
#
d src
d src/components
f src/components/Button.js
f src/index.js
f package.jsonEach export appends a new timestamped block — you keep a full history.
Safety
| Situation | Behaviour |
| ------------------------------ | ---------------------------- |
| Export on existing .snapshot | Appends — old data untouched |
| Restore on existing file/dir | Skips it — never overwrites |
| node_modules, .git | Always excluded from export |
Options
| Flag | Command | Description |
| --------------------- | ------------ | ---------------------------------- |
| -o, --output <file> | export | Output file (default: .snapshot) |
| --ignore <a,b> | export/tree | Comma-separated names to skip |
| -i, --input <file> | restore/tree | Snapshot file to read |
| -d, --dest <dir> | restore | Where to restore (default: cwd) |
| -n, --dry-run | restore | Preview without writing |
| --text "<text>" | restore | Restore from raw pasted text |
