Skip to content
Yash-Kumar-techPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

creator

A lightweight, cross-platform CLI tool built in Rust for quickly scaffolding project folder structures.

Features

  • 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.

Installation

Ensure you have Rust and Cargo installed, then clone the repository and build:

cargo build --release

The executable will be available in target/release/creator.

Usage

Basic Usage

Create files in the current directory:

creator main.py utils.py README.md

Create files in a specific target directory:

creator --path ./my_app src/main.rs tests/test_main.rs

Template Usage

Create 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.yaml

Capture Usage

Capture an existing directory structure into a new template:

creator --capture ./existing_project --output new_template.yaml

This will walk the directory, read file contents, and generate a YAML template that can be used to recreate the structure elsewhere.

Options

  • -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 to template.yaml).
  • [FILES]...: Additional file paths to create manually. Use a trailing slash (/) to explicitly create a directory.

Examples

Combining templates and manual arguments:

creator --template backend_template.yaml extra_config.json

Creating a specific folder structure:

creator "src/components/Header.js" "src/styles/main.css" "public/index.html"

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages