A simple tool to create a project structure (folders and files) from a given yaml structure. (vibe-coded)
- 🏗️ Create complex directory structures from simple text files
- 📁 Support for nested folders and files
- 🔍 Dry-run mode to preview changes
- 🎯 Customizable output directory
- 📝 YAML-like syntax that's easy to read and write
- ⚡ Fast and lightweight
git clone <repository-url>
cd file-structure-generator
nim c -d:release src/structgen.nimnimble installstructgen my_structure.yaml# Create structure in specific directory
structgen -o /path/to/output my_structure.yaml
# Dry run to see what would be created
structgen --dry-run my_structure.yaml
# Verbose output
structgen --verbose my_structure.yaml-h, --help: Show help message-o, --output DIR: Specify output directory (default: current directory)-d, --dry-run: Preview what would be created without actually creating-v, --verbose: Enable verbose output
The tool uses a YAML-like syntax:
- Directories: End with a colon
: - Files: Start with a dash and space
- - Indentation: Use 2 spaces for each level (consistent indentation required)
my_project:
src:
- main.nim
- config.nim
utils:
- helper.nim
- parser.nim
bin:
- app_executable
tests:
- test_main.nim
- test_utils.nim
docs:
assets:
- logo.png
- README.md
empty_folder:
- LICENSE
- .gitignoreThis creates:
my_project/
├── src/
│ ├── main.nim
│ ├── config.nim
│ └── utils/
│ ├── helper.nim
│ └── parser.nim
├── bin/
│ └── app_executable
├── tests/
│ ├── test_main.nim
│ └── test_utils.nim
├── docs/
│ ├── assets/
│ │ └── logo.png
│ └── README.md
├── empty_folder/
├── LICENSE
└── .gitignore
my_website:
public:
css:
- styles.css
js:
- main.js
- index.html
src:
- server.nim
- README.mdmy_lib:
src:
my_lib:
- core.nim
- utils.nim
- my_lib.nim
tests:
- test_core.nim
- test_utils.nim
examples:
- basic_usage.nim
docs:
- api.md
- README.md
- my_lib.nimble
- .gitignoreTo create empty directories, simply specify the directory name with a colon and no children:
project:
empty_dir:
another_empty:
- some_file.txtThe tool provides clear error messages for common issues:
- File not found: When the input file doesn't exist
- Parse errors: When the YAML-like syntax is invalid
- Permission errors: When unable to create files/directories
- Invalid paths: When specified paths are invalid
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
nim c src/structgen.nimnim c -r tests/test_all.nimnim c -d:release --opt:size src/structgen.nimMIT License - see LICENSE file for details.