1 unstable release
Uses new Rust 2024
new 0.1.0 | Apr 21, 2025 |
---|
#787 in Command line utilities
72 downloads per month
10KB
102 lines
DicStructureCreater
DicStructureCreater is a lightweight, cross-platform CLI tool that parses directory structures from .txt
or .md
files and generates corresponding folders and files under a specified root directory. By default, it avoids overwriting existing files, and supports dry-run (--dry-run
) and force overwrite (--overwrite
) modes.
README
Features
- 📁 Automatic generation: Generate folder structures and empty files from
tree
ASCII diagrams or Markdown-style lists. - 🔒 Safe by default: Existing files won't be overwritten unless explicitly allowed.
- 🔄 Optional overwrite: Use
--overwrite
(-O
) to force replace files. - 👀 Dry-run support: Use
--dry-run
(-d
) to preview actions without changing your file system. - ⚙️ Cross-platform: Built with Rust, compatible with Windows, macOS, and Linux.
Installation
Using Cargo
cargo install dic-structure-creater
Download Precompiled Binary
- Visit the Releases page:
https://github.com/natsuki221/DicStructureCreater/releases - Download the archive for your OS, extract it, and place
dsc
(ordsc.exe
) in your system'sPATH
.
Example Usage
Given a structure file structure.txt
:
src/
├── lib/
│ └── utils.rs
└── main.rs
- Preview only (dry-run):
dsc structure.txt --dry-run
- Generate structure (without overwriting existing files):
dsc structure.txt
- Force overwrite existing files:
dsc structure.txt --overwrite
CLI Options
Option | Description |
---|---|
STRUCTURE_FILE |
Path to the input structure file (required) |
-r, --root <path> |
Root directory to create files/folders (default: . ) |
-O, --overwrite |
Overwrite existing files |
-d, --dry-run |
Show actions without making changes |
-h, --help |
Display help message |
Supported Input Formats
DSC supports two main formats:
- Tree ASCII format:
src/
├── models/
│ └── user.rs
└── main.rs
- Markdown list format:
- src
- models
- user.rs
- main.rs
Note: Lines ending with
/
are treated as folders; otherwise, they are considered files.
Contributing
Contributions are welcome! You can submit Issues, Pull Requests, suggestions, or bug reports.
Steps:
- Fork this repository
- Create a new branch (
git checkout -b feature/your-feature
) - Implement your changes
- Submit a Pull Request
License
This project is licensed under the MIT License. See LICENSE for details.
For questions, feel free to open an issue or discussion. Happy hacking! 🚀
Dependencies
~1–1.6MB
~31K SLoC