Wed Jan 07 2026

Scaf, for Scaffolding

I wanted a clean cli tool to easily get the structure of folders and files on my stuff. There are a few, but no one quite the way I’d like it. So I developed scaf, for scaffolding. It’s both minimal, for quick use, but also has some really nice settings for a more nerdy analysis.

I also made it node-based, because I wanted something cross-platform. To install it globally in your machine, you’ll need node and some package manager of your choice, like npm. See bellow.

How to use

1. Install It

npm install -g @dandesdev/scaf

You absolutely don’t need to use npm, feel free to use any other package manager you like.

2. Run it

Decide from where you want your scaffolding, then, in your terminal, get to that location and simply run

scaf

You should see the entire scaffolding unfolding into your very eyes. It can be blazingly fast thou, so focus not to miss it.

3. Do more

From that point, you can use flags to do all sorts of stuff; I asked an AI friend of mine, and It gave us these awesome tables to explain it better:

Complete scaf Flags Table

Input and Output

FlagDescriptionExampleDefault
-p, --path <dir>Target directory to scanscaf -p ./srcCurrent directory
-md, --maxdepth <n>Maximum folder depth to scaf (0 = infinite)scaf -md 3Infinity
-o <file>Save output to file, it can be text or json. Format is auto-detected by extension (.txt, .json).scaf -o mystuff.jsonNo output file, it displays to console
-b, --bufferedUse buffered mode for text output (builds complete scaffolding before displaying) WARNING: It can crash your computer on large structures.scaf -b -o out.txtStreaming mode, it prints as it reads, this way there’s a low cap in memory usage.

File and Directory Filtering

FlagDescriptionExampleDefault
-i, --ignore <...>Patterns to ignore (space-separated)scaf -i node_modules dist config.yml *.logNothing, except what is specified in .gitignore, .dockerignore or .scafignore files, see more bellow.
-ti, --typed-ignoreEnable typed ignore mode, where files don’t need their extensions specified and folders must have trailing slashes (see table below).scaf -ti -i node_modules/ dist/ configfalse
-n, --only <...>Show only files matching patterns (directories always shown for navigation)scaf -n .ts .tsx[]
-d, --dirs-onlyDisplay only directories, hiding filesscaf -dfalse
--gitignore [true|false]Respect .gitignore rules. Accepts optional boolean valuescaf --gitignore falsetrue
--dockerignoreRespect .dockerignore rulesscaf --dockerignoretrue
-a, --show-hiddenShow hidden files and folders (dotfiles)scaf -afalse

Display and Format

FlagDescriptionExampleDefault
--sizeDisplay size of each filescaf --sizefalse
--sort <type>Sort entries by: name, size, datescaf --sort sizename
-q, --quietSuppress informational messages (useful for pipelines)scaf -qfalse

Statistics

FlagDescriptionExampleDefault
--stats [mode]Display basic statistics. Modes: console, include (in file), all (both)scaf --stats include -o out.txtconsole
--stats-only [mode]Display only detailed statistics. Modes: strict (honors filters) or all (ignores filters)scaf --stats-only allstrict

General

FlagDescriptionExampleDefault
-h, --helpDisplay help message and exitscaf --help-

Typed Ignore Mode (-ti)

When -ti is enabled, patterns in -i behave differently:

PatternEffectExample
nameIgnores files with that basename (any extension)scaf -ti -i index ignores index.js, index.ts
folder/Ignores folders with that namescaf -ti -i bin/ ignores folder bin/
*.Ignores all files (leaves only folders)scaf -ti -i *.
*/Ignores all folders (shows only files in root)scaf -ti -i */

Important: In typed mode, -ti and -i are meant to be used together, and patterns must come immediately after -i.

Automatic Ignore Files

Scaf always loads these files if present in the root:

FileLoaded by default?Comment
.scafignore✅ AlwaysCreate your custom patterns
.gitignore✅ With —gitignore (default: true)
.dockerignore✅ With —dockerignore (default: true)

Tip: Use scaf —help to see practical examples and common use cases.

Get in touch

If you have any ideas, critics, love or hate towards scaf, please get in touch. <3

More about me