[GH-ISSUE #452] Option (CLI and Config) to "collapse" output about children of certain directories #201

Closed
opened 2026-06-08 11:26:06 +03:00 by zhus · 4 comments
Owner

Originally created by @edbrannin on GitHub (Dec 5, 2024).
Original GitHub issue: https://github.com/bootandy/dust/issues/452

Sometimes there's a directory whose size I want to see, but whose children I don't care about.

Examples:

  • .git
    • (I almost never care about what's inside here, but knowing "This project's .git repo is 80% of the whole directory" would be helpful)
  • node_modules
    • (Maybe I want to rm -rf node_modules in a stale project, but I usually don't care which dependencies are big)
  • target in Maven projects
    • (Maybe I want to run mvn clean in some projects I haven't touched in months)
  • .next/cache as seen below

It would be heopful if I could set a list of directories to keep collapsed in the config file, rather than building up an alias[1] in my .zshrc

[1] Something like: alias dust=dust --collapse=.git --collapse=node_nodules --collapse=target --collapse=.next/cache

Example output where this would be helpful:

bruno % dust
 63M           ┌── lib                             │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 64M         ┌─┴ typescript                        │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 64M       ┌─┴ node_modules                        │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 64M     ┌─┴ bruno-query                           │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 63M     │     ┌── lib                             │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 64M     │   ┌─┴ typescript                        │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 64M     │ ┌─┴ node_modules                        │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 64M     ├─┴ bruno-common                          │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 63M     │     ┌── lib                             │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 64M     │   ┌─┴ typescript                        │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 64M     │ ┌─┴ node_modules                        │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 64M     ├─┴ bruno-graphql-docs                    │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 36M     │         ┌── _app.js                     │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░                                          │   2%
 58M     │       ┌─┴ pages                         │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░                                          │   3%
 64M     │     ┌─┴ chunks                          │███▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░                                          │   3%
 66M     │   ┌─┴ static                            │███▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░                                          │   3%
 38M     │   │   ┌── server-development            │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░                                          │   2%
 36M     │   │   │ ┌── 6.pack                      │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░                                          │   2%
 36M     │   │   │ ├── 15.pack                     │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░                                          │   2%
 83M     │   │   │ ├── 10.pack                     │███▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░                                          │   4%
 84M     │   │   │ ├── 9.pack                      │███▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░                                          │   4%
147M     │   │   │ ├── 8.pack                      │█████▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░                                          │   7%
406M     │   │   ├─┴ client-development            │██████████████▓▓▓░░░░░░░                                          │  20%
444M     │   │ ┌─┴ webpack                         │███████████████▓▓░░░░░░░                                          │  22%
444M     │   ├─┴ cache                             │███████████████▓▓░░░░░░░                                          │  22%
518M     │ ┌─┴ .next                               │█████████████████░░░░░░░                                          │  26%
520M     ├─┴ bruno-app                             │█████████████████░░░░░░░                                          │  26%
717M   ┌─┴ packages                                │████████████████████████                                          │  36%
 21M   │   ┌── lib                                 │█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   1%
 21M   │ ┌─┴ typescript                            │█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   1%
 23M   │ │   ┌── dist                              │█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   1%
 24M   │ │ ┌─┴ faker                               │█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   1%
 24M   │ ├─┴ @faker-js                             │█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   1%
 24M   │ ├── date-fns                              │█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   1%
 31M   │ │   ┌── Release                           │██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   2%
 31M   │ │ ┌─┴ build                               │██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   2%
 32M   │ ├─┴ canvas                                │██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   2%
 35M   │ ├── pdfjs-dist                            │██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   2%
 36M   │ │     ┌── dist                            │██▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   2%
 36M   │ │   ┌─┴ icons-react                       │██▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   2%
 80M   │ │ ┌─┴ icons                               │███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   4%
 80M   │ ├─┴ @tabler                               │███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   4%
 64M   │ │   ┌── compiled                          │███▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   3%
 99M   │ │ ┌─┴ dist                                │████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   5%
100M   │ ├─┴ next                                  │████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   5%
111M   │ │   ┌── next-swc.darwin-x64.node          │████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   6%
111M   │ │ ┌─┴ swc-darwin-x64                      │████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   6%
111M   │ ├─┴ @next                                 │████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   6%
 37M   │ │ ┌── mac                                 │██▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   2%
 22M   │ │ │   ┌── app-builder.exe                 │█▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   1%
 22M   │ │ │ ┌─┴ ia32                              │█▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   1%
 22M   │ │ │ │ ┌── app-builder.exe                 │█▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   1%
 22M   │ │ │ ├─┴ arm64                             │█▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   1%
 23M   │ │ │ │ ┌── app-builder.exe                 │█▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   1%
 23M   │ │ │ ├─┴ x64                               │█▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   1%
 68M   │ │ ├─┴ win                                 │███▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   3%
101M   │ │ ├── linux                               │████▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   5%
206M   │ ├─┴ app-builder-bin                       │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │  10%
 54M   │ │               ┌── Resources             │██▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   3%
162M   │ │               ├── Electron Framework    │██████▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │   8%
232M   │ │             ┌─┴ A                       │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │  12%
232M   │ │           ┌─┴ Versions                  │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │  12%
232M   │ │         ┌─┴ Electron Framework.framework│████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │  12%
233M   │ │       ┌─┴ Frameworks                    │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │  12%
233M   │ │     ┌─┴ Contents                        │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │  12%
233M   │ │   ┌─┴ Electron.app                      │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │  12%
242M   │ │ ┌─┴ dist                                │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │  12%
245M   │ ├─┴ electron                              │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                         │  12%
1.2G   ├─┴ node_modules                            │█████████████████████████████████████████                         │  63%
2.0G ┌─┴ .                                         │█████████████████████████████████████████████████████████████████ │ 100%

Desired result (absent whatever else would show up above these lines):

# mockup, not real program output
bruno % dust --collapse=node_modules --collapse=.next/cache
 64M       ┌── node_modules                        │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 64M     ┌─┴ bruno-query                           │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 64M     │ ┌── node_modules                        │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 64M     ├─┴ bruno-common                          │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 64M     │ ┌── node_modules                        │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 64M     ├─┴ bruno-graphql-docs                    │███░░░░░░░░░░░░░░░░░░░░░                                          │   3%
 36M     │         ┌── _app.js                     │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░                                          │   2%
 58M     │       ┌─┴ pages                         │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░                                          │   3%
 64M     │     ┌─┴ chunks                          │███▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░                                          │   3%
 66M     │   ┌─┴ static                            │███▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░                                          │   3%
444M     │   ├── cache                             │███████████████▓▓░░░░░░░                                          │  22%
518M     │ ┌─┴ .next                               │█████████████████░░░░░░░                                          │  26%
520M     ├─┴ bruno-app                             │█████████████████░░░░░░░                                          │  26%
717M   ┌─┴ packages                                │████████████████████████                                          │  36%
1.2G   ├── node_modules                            │█████████████████████████████████████████                         │  63%
2.0G ┌─┴ .                                         │█████████████████████████████████████████████████████████████████ │ 100%

The closest I can get right now is ignoring the directory with -X node_modules, but that completely removes it from the sizes shown: (See also #453)

bruno % dust -X node_modules
 16M       ┌── pack                       │██░                                                                        │   2%
 17M     ┌─┴ objects                      │██░                                                                        │   2%
 20M   ┌─┴ .git                           │███                                                                        │   3%
 10M   │         ┌── typescript.js        │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   1%
 10M   │         ├── typescriptServices.js│██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   1%
 11M   │         ├── tsserverlibrary.js   │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   1%
 11M   │         ├── tsserver.js          │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   2%
 63M   │       ┌─┴ lib                    │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   9%
 64M   │     ┌─┴ typescript               │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   9%
 64M   │   ┌─┴ node_modules               │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   9%
 64M   │ ┌─┴ bruno-query                  │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   9%
 10M   │ │       ┌── typescript.js        │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   1%
 10M   │ │       ├── typescriptServices.js│██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   1%
 11M   │ │       ├── tsserverlibrary.js   │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   1%
 11M   │ │       ├── tsserver.js          │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   2%
 63M   │ │     ┌─┴ lib                    │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   9%
 64M   │ │   ┌─┴ typescript               │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   9%
 64M   │ │ ┌─┴ node_modules               │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   9%
 64M   │ ├─┴ bruno-common                 │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   9%
 10M   │ │       ┌── typescript.js        │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   1%
 10M   │ │       ├── typescriptServices.js│██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   1%
 11M   │ │       ├── tsserverlibrary.js   │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   1%
 11M   │ │       ├── tsserver.js          │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   2%
 63M   │ │     ┌─┴ lib                    │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   9%
 64M   │ │   ┌─┴ typescript               │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   9%
 64M   │ │ ┌─┴ node_modules               │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   9%
 64M   │ ├─┴ bruno-graphql-docs           │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │   9%
 21M   │ │         ┌── index.js           │███▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░   │   3%
 36M   │ │         ├── _app.js            │████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░   │   5%
 58M   │ │       ┌─┴ pages                │██████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░   │   8%
 64M   │ │     ┌─┴ chunks                 │███████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░   │   9%
 66M   │ │   ┌─┴ static                   │███████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░   │   9%
 15M   │ │   │     ┌── 13.pack            │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░   │   2%
 38M   │ │   │   ┌─┴ server-development   │████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░   │   5%
 36M   │ │   │   │ ┌── 6.pack             │████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░   │   5%
 36M   │ │   │   │ ├── 15.pack            │████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░   │   5%
 83M   │ │   │   │ ├── 10.pack            │█████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░   │  11%
 84M   │ │   │   │ ├── 9.pack             │█████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░   │  11%
147M   │ │   │   │ ├── 8.pack             │███████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░   │  20%
406M   │ │   │   ├─┴ client-development   │█████████████████████████████████████████▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░   │  55%
444M   │ │   │ ┌─┴ webpack                │█████████████████████████████████████████████▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░   │  60%
444M   │ │   ├─┴ cache                    │█████████████████████████████████████████████▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░   │  60%
518M   │ │ ┌─┴ .next                      │████████████████████████████████████████████████████▒░░░░░░░░░░░░░░░░░░░   │  70%
520M   │ ├─┴ bruno-app                    │█████████████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░   │  70%
717M   ├─┴ packages                       │████████████████████████████████████████████████████████████████████████   │  97%
740M ┌─┴ .                                │██████████████████████████████████████████████████████████████████████████ │ 100%
Originally created by @edbrannin on GitHub (Dec 5, 2024). Original GitHub issue: https://github.com/bootandy/dust/issues/452 Sometimes there's a directory whose size I want to see, but whose children I don't care about. Examples: - `.git` - (I almost never care about what's inside here, but knowing "This project's `.git` repo is 80% of the whole directory" would be helpful) - `node_modules` - (Maybe I want to `rm -rf node_modules` in a stale project, but I usually don't care which dependencies are big) - `target` in Maven projects - (Maybe I want to run `mvn clean` in some projects I haven't touched in months) - `.next/cache` as seen below It would be heopful if I could set a list of directories to keep collapsed in the config file, rather than building up an alias[1] in my `.zshrc` [1] Something like: `alias dust=dust --collapse=.git --collapse=node_nodules --collapse=target --collapse=.next/cache` Example output where this would be helpful: ```bash bruno % dust 63M ┌── lib │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 64M ┌─┴ typescript │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 64M ┌─┴ node_modules │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 64M ┌─┴ bruno-query │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 63M │ ┌── lib │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 64M │ ┌─┴ typescript │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 64M │ ┌─┴ node_modules │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 64M ├─┴ bruno-common │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 63M │ ┌── lib │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 64M │ ┌─┴ typescript │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 64M │ ┌─┴ node_modules │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 64M ├─┴ bruno-graphql-docs │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 36M │ ┌── _app.js │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░ │ 2% 58M │ ┌─┴ pages │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░ │ 3% 64M │ ┌─┴ chunks │███▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░ │ 3% 66M │ ┌─┴ static │███▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░ │ 3% 38M │ │ ┌── server-development │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░ │ 2% 36M │ │ │ ┌── 6.pack │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░ │ 2% 36M │ │ │ ├── 15.pack │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░ │ 2% 83M │ │ │ ├── 10.pack │███▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░ │ 4% 84M │ │ │ ├── 9.pack │███▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░ │ 4% 147M │ │ │ ├── 8.pack │█████▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░ │ 7% 406M │ │ ├─┴ client-development │██████████████▓▓▓░░░░░░░ │ 20% 444M │ │ ┌─┴ webpack │███████████████▓▓░░░░░░░ │ 22% 444M │ ├─┴ cache │███████████████▓▓░░░░░░░ │ 22% 518M │ ┌─┴ .next │█████████████████░░░░░░░ │ 26% 520M ├─┴ bruno-app │█████████████████░░░░░░░ │ 26% 717M ┌─┴ packages │████████████████████████ │ 36% 21M │ ┌── lib │█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 21M │ ┌─┴ typescript │█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 23M │ │ ┌── dist │█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 24M │ │ ┌─┴ faker │█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 24M │ ├─┴ @faker-js │█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 24M │ ├── date-fns │█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 31M │ │ ┌── Release │██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 2% 31M │ │ ┌─┴ build │██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 2% 32M │ ├─┴ canvas │██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 2% 35M │ ├── pdfjs-dist │██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 2% 36M │ │ ┌── dist │██▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 2% 36M │ │ ┌─┴ icons-react │██▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 2% 80M │ │ ┌─┴ icons │███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 4% 80M │ ├─┴ @tabler │███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 4% 64M │ │ ┌── compiled │███▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 3% 99M │ │ ┌─┴ dist │████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 5% 100M │ ├─┴ next │████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 5% 111M │ │ ┌── next-swc.darwin-x64.node │████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 6% 111M │ │ ┌─┴ swc-darwin-x64 │████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 6% 111M │ ├─┴ @next │████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 6% 37M │ │ ┌── mac │██▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 2% 22M │ │ │ ┌── app-builder.exe │█▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 22M │ │ │ ┌─┴ ia32 │█▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 22M │ │ │ │ ┌── app-builder.exe │█▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 22M │ │ │ ├─┴ arm64 │█▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 23M │ │ │ │ ┌── app-builder.exe │█▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 23M │ │ │ ├─┴ x64 │█▓▓▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 68M │ │ ├─┴ win │███▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 3% 101M │ │ ├── linux │████▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 5% 206M │ ├─┴ app-builder-bin │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 10% 54M │ │ ┌── Resources │██▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 3% 162M │ │ ├── Electron Framework │██████▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 8% 232M │ │ ┌─┴ A │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 12% 232M │ │ ┌─┴ Versions │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 12% 232M │ │ ┌─┴ Electron Framework.framework│████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 12% 233M │ │ ┌─┴ Frameworks │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 12% 233M │ │ ┌─┴ Contents │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 12% 233M │ │ ┌─┴ Electron.app │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 12% 242M │ │ ┌─┴ dist │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 12% 245M │ ├─┴ electron │████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 12% 1.2G ├─┴ node_modules │█████████████████████████████████████████ │ 63% 2.0G ┌─┴ . │█████████████████████████████████████████████████████████████████ │ 100% ``` Desired result (absent whatever else would show up above these lines): ``` # mockup, not real program output bruno % dust --collapse=node_modules --collapse=.next/cache 64M ┌── node_modules │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 64M ┌─┴ bruno-query │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 64M │ ┌── node_modules │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 64M ├─┴ bruno-common │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 64M │ ┌── node_modules │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 64M ├─┴ bruno-graphql-docs │███░░░░░░░░░░░░░░░░░░░░░ │ 3% 36M │ ┌── _app.js │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░ │ 2% 58M │ ┌─┴ pages │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░ │ 3% 64M │ ┌─┴ chunks │███▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░ │ 3% 66M │ ┌─┴ static │███▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░ │ 3% 444M │ ├── cache │███████████████▓▓░░░░░░░ │ 22% 518M │ ┌─┴ .next │█████████████████░░░░░░░ │ 26% 520M ├─┴ bruno-app │█████████████████░░░░░░░ │ 26% 717M ┌─┴ packages │████████████████████████ │ 36% 1.2G ├── node_modules │█████████████████████████████████████████ │ 63% 2.0G ┌─┴ . │█████████████████████████████████████████████████████████████████ │ 100% ``` The closest I can get right now is ignoring the directory with `-X node_modules`, but that completely removes it from the sizes shown: (See also #453) ```bash bruno % dust -X node_modules 16M ┌── pack │██░ │ 2% 17M ┌─┴ objects │██░ │ 2% 20M ┌─┴ .git │███ │ 3% 10M │ ┌── typescript.js │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 10M │ ├── typescriptServices.js│██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 11M │ ├── tsserverlibrary.js │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 11M │ ├── tsserver.js │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 2% 63M │ ┌─┴ lib │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 9% 64M │ ┌─┴ typescript │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 9% 64M │ ┌─┴ node_modules │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 9% 64M │ ┌─┴ bruno-query │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 9% 10M │ │ ┌── typescript.js │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 10M │ │ ├── typescriptServices.js│██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 11M │ │ ├── tsserverlibrary.js │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 11M │ │ ├── tsserver.js │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 2% 63M │ │ ┌─┴ lib │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 9% 64M │ │ ┌─┴ typescript │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 9% 64M │ │ ┌─┴ node_modules │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 9% 64M │ ├─┴ bruno-common │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 9% 10M │ │ ┌── typescript.js │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 10M │ │ ├── typescriptServices.js│██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 11M │ │ ├── tsserverlibrary.js │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 1% 11M │ │ ├── tsserver.js │██▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 2% 63M │ │ ┌─┴ lib │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 9% 64M │ │ ┌─┴ typescript │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 9% 64M │ │ ┌─┴ node_modules │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 9% 64M │ ├─┴ bruno-graphql-docs │███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ │ 9% 21M │ │ ┌── index.js │███▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░ │ 3% 36M │ │ ├── _app.js │████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░ │ 5% 58M │ │ ┌─┴ pages │██████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░ │ 8% 64M │ │ ┌─┴ chunks │███████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░ │ 9% 66M │ │ ┌─┴ static │███████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░ │ 9% 15M │ │ │ ┌── 13.pack │██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░ │ 2% 38M │ │ │ ┌─┴ server-development │████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░ │ 5% 36M │ │ │ │ ┌── 6.pack │████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░ │ 5% 36M │ │ │ │ ├── 15.pack │████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░ │ 5% 83M │ │ │ │ ├── 10.pack │█████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░ │ 11% 84M │ │ │ │ ├── 9.pack │█████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░ │ 11% 147M │ │ │ │ ├── 8.pack │███████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░ │ 20% 406M │ │ │ ├─┴ client-development │█████████████████████████████████████████▓▓▓▓▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░ │ 55% 444M │ │ │ ┌─┴ webpack │█████████████████████████████████████████████▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░ │ 60% 444M │ │ ├─┴ cache │█████████████████████████████████████████████▓▓▓▓▓▓▓▒░░░░░░░░░░░░░░░░░░░ │ 60% 518M │ │ ┌─┴ .next │████████████████████████████████████████████████████▒░░░░░░░░░░░░░░░░░░░ │ 70% 520M │ ├─┴ bruno-app │█████████████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░ │ 70% 717M ├─┴ packages │████████████████████████████████████████████████████████████████████████ │ 97% 740M ┌─┴ . │██████████████████████████████████████████████████████████████████████████ │ 100% ```
zhus closed this issue 2026-06-08 11:26:06 +03:00
Author
Owner

@bootandy commented on GitHub (Jan 15, 2025):

I see, that's interesting. Yes I think we can add this

<!-- gh-comment-id:2593752172 --> @bootandy commented on GitHub (Jan 15, 2025): I see, that's interesting. Yes I think we can add this
Author
Owner

@bootandy commented on GitHub (Jan 26, 2025):

https://github.com/bootandy/dust/pull/466

<!-- gh-comment-id:2614471510 --> @bootandy commented on GitHub (Jan 26, 2025): https://github.com/bootandy/dust/pull/466
Author
Owner

@edbrannin commented on GitHub (Feb 21, 2025):

Thank you!

<!-- gh-comment-id:2674747565 --> @edbrannin commented on GitHub (Feb 21, 2025): Thank you!
Author
Owner

@ofek commented on GitHub (Nov 19, 2025):

I'm not sure that this is working as expected: https://github.com/bootandy/dust/issues/536

<!-- gh-comment-id:3550404792 --> @ofek commented on GitHub (Nov 19, 2025): I'm not sure that this is working as expected: https://github.com/bootandy/dust/issues/536
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#201