Skip to content

Code Scaffolder is a powerful command-line tool that converts your natural language descriptions into working code across multiple programming languages and project types. Using smart pattern recognition and template-based generation, it provides an intuitive way to scaffold applications, scripts, and tools without writing boilerplate code manually

Notifications You must be signed in to change notification settings

cbunting99/code-scaffolder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Code Scaffolder - Smart Template-Based Code Generator

πŸš€ Transform natural language prompts into functional code using intelligent template scaffolding

Code Scaffolder is a powerful command-line tool that converts your natural language descriptions into working code across multiple programming languages and project types. Using smart pattern recognition and template-based generation, it provides an intuitive way to scaffold applications, scripts, and tools without writing boilerplate code manually.

✨ Features

  • πŸ—£οΈ Natural Language Parsing: Describe what you want in plain English
  • 🌐 Multi-Language Support: Python, JavaScript, TypeScript, Java, C++, Go, Rust, PHP, Ruby, Bash, HTML, CSS, SQL
  • πŸ—οΈ Project Templates: Web apps, APIs, CLI tools, desktop apps, mobile apps, libraries, scripts
  • 🎯 Smart Pattern Recognition: Automatically detects language and project type from prompts
  • πŸ”„ Interactive Mode: Real-time code scaffolding with immediate feedback
  • πŸ“ Template System: Extensible template-based code generation with placeholder replacement
  • 🎨 Modern UI: Beautiful HTML templates with responsive design
  • πŸ“ Comprehensive Logging: Detailed logs for debugging and monitoring
  • ⚑ Fast Generation: No external API calls - everything runs locally

πŸš€ Quick Start

Prerequisites

  • Bash shell (Git Bash on Windows, Terminal on macOS/Linux)
  • Node.js (for JavaScript projects)
  • Python 3.7+ (for Python projects)

Installation

  1. Clone the repository:

    git clone https://github.com/cbunting99/code-scaffolder.git
    cd code-scaffolder
  2. Make the script executable:

    chmod +x code-scaffolder.sh
  3. Install dependencies (optional, for generated projects):

    # For Node.js projects
    npm install
    
    # For Python projects
    pip install -r requirements.txt

Basic Usage

Command Line Mode

# Generate a Python web app
./code-scaffolder.sh "create a python web app called TodoApp with database and authentication"

# Generate a JavaScript API
./code-scaffolder.sh "build a REST API in Node.js for user management"

# Generate a CLI tool
./code-scaffolder.sh "create a bash script for file backup and compression"

# Specify output file
./code-scaffolder.sh -o myapp.py "build a calculator in python"

Interactive Mode

./code-scaffolder.sh -i

Then type your prompts:

bashchat> create a react web app for task management
bashchat> build a python CLI tool for data processing
bashchat> help
bashchat> exit

πŸ“– Usage Examples

Web Applications

# Python Flask web app
./code-scaffolder.sh "create a python web app called BlogApp with user authentication and database"

# Node.js Express API
./code-scaffolder.sh "build a javascript web api for e-commerce with payment integration"

# HTML landing page
./code-scaffolder.sh "create an html website for a tech startup with modern design"

CLI Tools

# Python CLI
./code-scaffolder.sh "create a python command line tool for log analysis"

# Bash script
./code-scaffolder.sh "build a bash script for automated server deployment"

# Go CLI
./code-scaffolder.sh "create a go cli tool for file synchronization"

Data Processing

# Python data script
./code-scaffolder.sh "create a python script for CSV data processing and visualization"

# SQL database
./code-scaffolder.sh "build sql schema for inventory management system"

πŸ› οΈ Command Line Options

Usage: ./code-scaffolder.sh [OPTIONS] [PROMPT]

Options:
  -i, --interactive    Start interactive mode
  -o, --output FILE    Specify output file
  -l, --language LANG  Force specific language
  -t, --type TYPE      Force specific project type
  -h, --help          Show help message

Examples:
  ./code-scaffolder.sh "create a python web app called TodoApp"
  ./code-scaffolder.sh -i
  ./code-scaffolder.sh -o myapp.py "build a calculator in python"

🎯 Supported Languages & Project Types

Programming Languages

  • Python - Web apps, CLI tools, data processing
  • JavaScript - Web apps, APIs, frontend
  • TypeScript - Type-safe web applications
  • Java - Enterprise applications
  • C++ - System programming
  • C# - .NET applications
  • Go - Microservices, CLI tools
  • Rust - System programming, web backends
  • PHP - Web applications
  • Ruby - Web apps, scripts
  • Bash - System scripts, automation
  • HTML/CSS - Static websites
  • SQL - Database schemas

Project Types

  • web_app - Full web applications
  • api - REST APIs and web services
  • cli - Command-line tools
  • desktop - Desktop applications
  • mobile - Mobile app templates
  • library - Reusable code libraries
  • script - Utility scripts

πŸ“ Project Structure

bashchat/
β”œβ”€β”€ bashchat.sh           # Main script
β”œβ”€β”€ config/
β”‚   └── settings.json     # Configuration file
β”œβ”€β”€ templates/            # Code templates
β”‚   β”œβ”€β”€ python_web_app.template
β”‚   β”œβ”€β”€ javascript_web_app.template
β”‚   β”œβ”€β”€ html_web_app.template
β”‚   └── ...
β”œβ”€β”€ generated/            # Generated code output
β”œβ”€β”€ logs/                 # Application logs
β”œβ”€β”€ plugins/              # Extension plugins
β”œβ”€β”€ package.json          # Node.js dependencies
β”œβ”€β”€ requirements.txt      # Python dependencies
└── README.md            # This file

πŸ”§ Configuration

Edit config/settings.json to customize behavior:

{
    "ai_provider": "openai",
    "model": "gpt-4",
    "max_tokens": 2000,
    "temperature": 0.7,
    "supported_languages": ["python", "javascript", "..."]
    "default_language": "python",
    "output_format": "file",
    "include_comments": true,
    "include_tests": true,
    "code_style": "clean"
}

🎨 Template System

BashChat uses a powerful template system with placeholders:

  • {{APP_NAME}} - Application name
  • {{DESCRIPTION}} - Project description
  • {{LANGUAGE}} - Programming language
  • {{PROJECT_TYPE}} - Project type
  • {{FEATURES}} - Detected features
  • {{DATE}} - Current date
  • {{TIMESTAMP}} - Current timestamp

Creating Custom Templates

  1. Create a new template file in templates/:

    touch templates/python_custom.template
  2. Add your template with placeholders:

    #!/usr/bin/env python3
    """
    {{APP_NAME}} - {{DESCRIPTION}}
    Generated on {{DATE}}
    """
    
    def main():
        print("Hello from {{APP_NAME}}!")
    
    if __name__ == '__main__':
        main()

πŸš€ Advanced Usage

Batch Generation

# Generate multiple files
echo "create a python web app called UserApp" | ./bashchat.sh
echo "build a javascript api for UserApp" | ./bashchat.sh
echo "create html frontend for UserApp" | ./bashchat.sh

Integration with CI/CD

# .github/workflows/generate.yml
name: Generate Code
on: [push]
jobs:
  generate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Generate Code
        run: |
          chmod +x code-scaffolder.sh
          ./code-scaffolder.sh "${{ github.event.head_commit.message }}"

πŸ› Troubleshooting

Common Issues

  1. Permission denied:

    chmod +x code-scaffolder.sh
  2. Template not found:

    • Check if templates exist in templates/ directory
    • Verify language and project type detection
  3. Dependencies missing:

    npm install          # For Node.js
    pip install -r requirements.txt  # For Python

Debug Mode

# Enable verbose logging
DEBUG=1 ./code-scaffolder.sh "your prompt here"

# Check logs
tail -f logs/codescaffolder.log

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes
  4. Add tests if applicable
  5. Commit: git commit -am 'Add feature'
  6. Push: git push origin feature-name
  7. Submit a pull request

Adding New Languages

  1. Create templates in templates/:

    templates/newlang_web_app.template
    templates/newlang_default.template
  2. Update language detection in code-scaffolder.sh:

    elif [[ "$prompt" =~ (newlang) ]]; then
        language="newlang"
  3. Add file extension mapping:

    "newlang") extension="ext" ;;

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ™ Acknowledgments

  • Inspired by Claude Code and modern AI development tools
  • Built with love for the developer community
  • Thanks to all contributors and users

πŸ“ž Support


Made with ❀️ by the Code Scaffolder team

Transform your ideas into code with the power of intelligent template scaffolding!

About

Code Scaffolder is a powerful command-line tool that converts your natural language descriptions into working code across multiple programming languages and project types. Using smart pattern recognition and template-based generation, it provides an intuitive way to scaffold applications, scripts, and tools without writing boilerplate code manually

Resources

Stars

Watchers

Forks