This English Readme is translated by
o3-mini, please understand if there is any incomprehension.
English | 简体中文
treegen is a tool that generates file/folder trees based on specifications written in Markdown, YAML, JSON, TOML, and JSON5.
When programming for AI, it is often necessary to have AI generate a project directory structure, and it is very troublesome to manually create files and folders based on the project directory structure. Therefore, this tool was developed to generate a file/directory tree based on Markdown, YAML, JSON, TOML, and JSON5 descriptions.
- Supports multiple document formats
- Preview the structure before creating files/directories
- Allows custom file permissions and cleaning pre-existing directories
- Prepare a specification file (e.g., tree.md, tree.yaml, etc.).
- Run the command-line tool with the specification file and output directory options.
- Check the output where the generated file tree will be created.
treegen tree.yaml --out output --verbose
project/
├── src/
│ ├── main.rs
│ └── lib.rs
├── Cargo.toml
└── README.md- specification: One or more specification files (supports .md, .yaml, .yml, .json, .toml, .json5).
- out: Output root directory; default is the current working directory.
- dry_run: Preview actions without writing to disk.
- verbose: Print detailed logs for every file/directory creation.
- clean: Clean existing same-named paths in the output directory before creation.
- mode: Permission for created files (octal, e.g., 0o644), effective on Unix platforms.