A lightweight, cross-platform CLI tool built in Rust for quickly scaffolding project folder structures.
- Manual File Creation: Specify file paths as positional arguments.
- Nested Directory Support: Automatically creates parent directories for any specified path.
- Template Support: Define complex structures and initial file contents using YAML templates.
- Template Capture: Automatically generate a template from an existing directory structure.
- Cross-Platform: Works seamlessly on Windows, Linux, and macOS.
- Safe Creation: Skips files that already exist to prevent data loss.
Ensure you have Rust and Cargo installed, then clone the repository and build:
cargo build --releaseThe executable will be available in target/release/creator.
Create files in the current directory:
creator main.py utils.py README.mdCreate files in a specific target directory:
creator --path ./my_app src/main.rs tests/test_main.rsCreate a template.yaml file:
- path: src/main.rs
content: |
fn main() {
println!("Hello, world!");
}
- path: docs/
- path: README.md
content: "# New Project"Apply the template:
creator --template template.yamlCapture an existing directory structure into a new template:
creator --capture ./existing_project --output new_template.yamlThis will walk the directory, read file contents, and generate a YAML template that can be used to recreate the structure elsewhere.
-p,--path <PATH>: The base directory where files should be created (defaults to.).-t,--template <FILE>: A YAML template file defining the structure and contents.-c,--capture <DIR>: Capture an existing directory structure into a template.-o,--output <FILE>: Output file for the captured template (defaults totemplate.yaml).[FILES]...: Additional file paths to create manually. Use a trailing slash (/) to explicitly create a directory.
Combining templates and manual arguments:
creator --template backend_template.yaml extra_config.jsonCreating a specific folder structure:
creator "src/components/Header.js" "src/styles/main.css" "public/index.html"