Skip to content

A powerful command-line tool for quickly scaffolding new projects with predefined templates for multiple programming languages. This tool creates project structures with common files, build configurations, and best practices for each supported language.

Notifications You must be signed in to change notification settings

jcmspg/project_scaffolding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Project Init - Multi-Language Project Scaffolding Tool

A powerful command-line tool for quickly scaffolding new projects with predefined templates for multiple programming languages. This tool creates project structures with common files, build configurations, and best practices for each supported language.

project init demo

Table of Contents

Features

  • πŸš€ Quick Project Setup: Create new projects in seconds with predefined templates
  • 🌐 Multi-Language Support: Templates for C, C++, Python, JavaScript, Frontend (HTML/CSS/JS), Rust, and Go
  • πŸ“ Organized Structure: Each template includes appropriate directory structure and starter files
  • πŸ”§ Build System Ready: Includes Makefiles, package.json, Cargo.toml, and other build configurations
  • πŸ“ Git Integration: Automatically initializes Git repository
  • πŸ™ GitHub Integration: Optional automatic GitHub repository creation and push
  • βš™οΈ Easy Installation: Simple setup script for system-wide availability
  • πŸ”„ Version Management: Intelligent version checking to avoid overwriting newer installations

Supported Languages and Templates

Language Template Includes
C Makefile, includes/, srcs/, main.c, .gitignore
C++ Makefile, include/, src/, main.cpp, .gitignore
Python package structure, requirements.txt, tests/, .gitignore
JavaScript package.json, index.js, lib/, .gitignore
Frontend index.html, style.css, script.js, assets/, .gitignore
Rust Cargo.toml, src/main.rs, .gitignore
Go go.mod, main.go, .gitignore

Installation

Quick Install

./setup.sh install

Manual Installation

  1. Clone or download this repository
  2. Run the setup script:
    chmod +x setup.sh createproj generate_template.sh
    ./setup.sh install
  3. Restart your terminal or source your shell configuration:
    source ~/.bashrc  # or ~/.zshrc

The installer will:

  • Copy scripts to ~/bin/
  • Add ~/bin to your PATH
  • Create backups of your shell configuration
  • Generate templates in ~/.createproj_templates/

Usage

Basic Usage

createproj --lang <language> <project-name>

With GitHub Integration

createproj --lang <language> <project-name> --github

Examples

Create a C project:

createproj --lang c my-c-tool

Create a Python project with GitHub repo:

createproj --lang python my-python-script --github

Create a Rust project:

createproj --lang rust my-rust-app

Create a frontend project:

createproj --lang frontend my-website

Command Options

Option Description
--lang <language> Specify the project language (c, cpp, python, js, frontend, rust, go)
--github Create and push to a GitHub repository (requires GitHub CLI)
-h, --help Show help menu

Template Details

C Template

project_name/
β”œβ”€β”€ includes/
β”‚   β”œβ”€β”€ includes.h
β”‚   └── typedefs.h
β”œβ”€β”€ srcs/
β”‚   └── main.c
β”œβ”€β”€ extLibs/
β”œβ”€β”€ obj/
β”œβ”€β”€ Makefile
β”œβ”€β”€ README.md
└── .gitignore

Python Template

project_name/
β”œβ”€β”€ project_name/
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── main.py
β”œβ”€β”€ tests/
β”‚   └── test_main.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
└── .gitignore

Rust Template

project_name/
β”œβ”€β”€ src/
β”‚   └── main.rs
β”œβ”€β”€ Cargo.toml
β”œβ”€β”€ README.md
└── .gitignore

Requirements

Core Requirements

  • Bash shell
  • Git

Optional Requirements

  • GitHub CLI (gh): Required for --github flag
    # Install GitHub CLI
    # Ubuntu/Debian:
    sudo apt install gh
    # macOS:
    brew install gh
    # Then authenticate:
    gh auth login

Configuration

Template Customization

Templates are stored in ~/.createproj_templates/. You can customize any template by editing the files in the respective language directory.

Adding New Templates

  1. Create a new directory in ~/.createproj_templates/
  2. Add your template files
  3. Update generate_template.sh to include your new template

Uninstallation

To remove the tool completely:

./setup.sh uninstall

This will:

  • Remove scripts from ~/bin/
  • Clean PATH modifications from shell configuration
  • Create backups before making changes

File Structure

project-init/
β”œβ”€β”€ setup.sh              # Installation/uninstallation script
β”œβ”€β”€ createproj            # Main project creation script
β”œβ”€β”€ generate_template.sh   # Template generation script
└── README.md             # This file

Version Management

The tool includes intelligent version management:

  • Each script contains a version number
  • Installation checks for newer versions before overwriting
  • Prevents accidental downgrades

Troubleshooting

Common Issues

Command not found after installation:

# Reload your shell configuration
source ~/.bashrc  # or ~/.zshrc

# Or restart your terminal

GitHub integration fails:

# Install and authenticate GitHub CLI
gh auth login

Template not found:

# Regenerate templates
./generate_template.sh

Getting Help

Run createproj --help for usage information and examples.

Contributing

Contributions are welcome! Here's how you can help improve this project:

Ways to Contribute

  • πŸ› Report Bugs: Open an issue describing the bug with steps to reproduce
  • πŸ’‘ Suggest Features: Propose new languages, templates, or functionality
  • πŸ“ Improve Documentation: Help make the README clearer or add examples
  • πŸ”§ Add Templates: Create templates for new languages or frameworks
  • πŸš€ Code Improvements: Optimize existing code or add new features

How to Contribute

  1. Fork the repository on GitHub
  2. Create a feature branch from main:
    git checkout -b feature/your-feature-name
  3. Make your changes:
    • Add or modify templates in generate_template.sh
    • Update version numbers in scripts if needed
    • Test your changes thoroughly
  4. Update documentation if needed
  5. Commit your changes with clear, descriptive messages
  6. Push to your fork and create a pull request
  7. Describe your changes in the pull request description

Development Guidelines

  • Follow existing code style and patterns
  • Test new templates thoroughly
  • Update the README if adding new features
  • Ensure all scripts remain POSIX-compliant where possible
  • Add appropriate error handling

Ideas for Future Contributions

  • New Language Templates: Java, PHP, TypeScript, Swift, Kotlin
  • Framework Templates: React, Vue, Django, Flask, Express
  • Advanced Features: Custom template repositories, interactive setup
  • Platform Support: Windows PowerShell compatibility
  • Documentation: Video tutorials, advanced usage examples

We appreciate all contributions, big and small! πŸ™

License

This project is open source. Feel free to use, modify, and distribute.

Changelog

Version 1.0

  • Initial release
  • Support for C, C++, Python, JavaScript, Frontend, Rust, and Go
  • GitHub integration
  • Intelligent installation system
  • Version management

About

A powerful command-line tool for quickly scaffolding new projects with predefined templates for multiple programming languages. This tool creates project structures with common files, build configurations, and best practices for each supported language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages