dirinit is a versatile command-line tool that creates directory structures from tree-like, indented, or path text representations.

To install dirinit, simply run:
curl -sSL https://raw.githubusercontent.com/bendemonium/dirinit/main/install.sh | bash
This will download and run the installation script, which will handle all necessary setup.
dirinit [options] [file]
Options:
-h Show help message
-t Use tree format (default if no format specified)
-i Use indented format
-p Use path format
file Optional input file (if not provided, will prompt for input)
Examples:
-
Using a file with tree format:
dirinit -t structure.txt
-
Using a file with indented format:
dirinit -i structure.txt
-
Using a file with path format:
dirinit -p structure.txt
-
Without a file (will prompt for input):
dirinit -t
-
Show help:
dirinit -h
dirinit supports three input formats:
-
Tree-like format using │├└ characters (use -t):
├── dir1 │ ├── file11.ext │ └── file12.ext └── dir2 └── file21.ext
-
Simple indented format using spaces (use -i):
dir1 file11.ext file12.ext dir2 file21.ext
-
Path format (use -p):
dir1/file11.ext dir1/file12.ext dir2/file21.ext
dirinit will automatically attempt to install its dependencies:
- On macOS: It uses Homebrew to install the
newt
package (which includeswhiptail
). - On Linux: It uses
apt-get
oryum
to installwhiptail
.
If the automatic installation fails, you may need to install these dependencies manually.