A comprehensive template generation system for creating various files and project structures with intelligent smart append functionality.
- Make the main script executable:
chmod +x generate/generate
- Create a symbolic link to make it available system-wide:
sudo ln -sf "$(pwd)/generate/generate" /usr/local/bin/generate
generate <type> [options]
Generate licenses with intelligent auto-detection:
# Basic usage - auto-detects name and date
generate license MIT
# Specify custom name, auto-detect date
generate license Apache-2.0 "Your Name"
# Full manual control
generate license BSD-3-Clause "Company Name" 2024
The smart append feature automatically generates related templates, configurations, and directory structures based on the technology you specify. Simply use:
generate <technology> [project-name] [options]
Available Smart Append Commands:
generate electron my-app # Electron app + Node gitignore + ESLint + Prettier + VS Code config
generate react my-frontend # React frontend + React gitignore + ESLint + Prettier + VS Code config
generate nextjs my-fullstack # Next.js fullstack + Next.js gitignore + ESLint + Prettier + VS Code config
generate python my-backend # Python project + Python gitignore + VS Code config
generate fastapi my-api # FastAPI backend + FastAPI gitignore + Docker + VS Code config
generate node my-server # Node.js project + Node gitignore + ESLint + Prettier + VS Code config
generate microservices my-stack # Microservices + Docker + Kubernetes + Monitoring configs
generate fullstack my-app # Next.js + FastAPI + Docker + All configs
generate docker my-project # Docker configs + Docker gitignore
Smart Append Options:
--dry-run
- Show what would be generated without creating files-o, --output <path>
- Specify output directory
Examples:
# See what would be generated
generate electron --dry-run
# Create Electron app in specific directory
generate electron my-app -o ./projects/
# Create full-stack setup with custom name
generate fullstack awesome-app
Generate proper license files with intelligent name and date detection:
generate license <type> [fullname] [year]
Available license types:
MIT
- MIT License (simple and permissive)Apache-2.0
- Apache License 2.0 (with patent protection)BSD-3-Clause
- BSD 3-Clause License (with attribution requirements)GRIFFIN
- Custom Griffin License (with special attribution requirements)
Smart Detection Features:
- Automatic Name Detection: Scans
package.json
,pyproject.toml
,Cargo.toml
, git config, and more - Intelligent Date Ranges: Auto-detects project start year from git history (e.g., "2020-2025")
- Project-Aware: Prioritizes project-specific information over generic settings
Examples:
# Auto-detect name and date from project context
generate license MIT
# Auto-detect name, specify year
generate license Apache-2.0 "" 2023
# Manual override
generate license BSD-3-Clause "Your Company Inc" 2024
# See what would be detected
generate license MIT --dry-run
Generate .gitignore
files for various languages and frameworks:
generate gitignore <language>
Available languages:
python
- Python projectsnode
- Node.js projectsreact
- React applicationsnextjs
- Next.js applicationsfastapi
- FastAPI backend projectsjava
- Java projectsgo
- Go projectsrust
- Rust projectscsharp
- C# projectscpp
- C++ projectsmacos
- macOS specific filesdocker
- Docker projectsmicroservices
- Microservices architecture
Examples:
generate gitignore python
generate gitignore node
generate gitignore react
Generate complete project directory structures:
generate directory <type> [project-name] [output-path]
Available types:
python
- Python project with src/, tests/, docs/, etc.node
- Node.js project with proper structureelectron
- Electron desktop application structurereact-frontend
- React frontend with modern toolingnextjs-fullstack
- Next.js with API routes and databasefastapi-backend
- FastAPI with SQLAlchemy and Alembicmicroservices
- Complete microservices architecture
Examples:
generate directory python my-python-app
generate directory electron my-desktop-app
generate directory microservices my-stack ./projects/
Generate configuration files for development tools:
generate config <type> [output-path]
Available types:
docker
- Dockerfile, docker-compose.yml, .dockerignoreeslint
- ESLint configurationprettier
- Prettier configurationvscode
- VS Code settings and extensionskubernetes
- Kubernetes manifeststerraform
- Terraform AWS infrastructuregithub-actions
- GitHub Actions workflowsmonitoring
- Prometheus & Grafana configuration
Examples:
generate config docker
generate config eslint
generate config kubernetes
The license generator features sophisticated auto-detection capabilities:
-
Project Files (Highest Priority)
package.json
β"author": "Name"
or author objectpyproject.toml
βauthors = [{name = "Name"}]
Cargo.toml
βauthors = ["Name"]
composer.json
β author information
-
Existing License Files
- Extracts current copyright holder from LICENSE files
-
Git Configuration & History
git config user.name
(when different from system user)- Primary contributor analysis from commit history
-
Repository Context
- GitHub/GitLab repository owner names
- Converts usernames to readable format
-
System Fallback
- System username as last resort
- Git History Analysis: Finds earliest commit year
- File System Scanning: Checks source file modification dates
- Smart Ranges: Creates "2020-2025" format for multi-year projects
- Current Year Fallback: Uses current year for new projects
-h, --help
- Show help message-l, --list
- List all available templates (including licenses) π-s, --smart
- List available smart append options-o, --output <path>
- Specify output path (default: current directory)--dry-run
- Show what would be generated without creating files
Command | Description | Example |
---|---|---|
license <type> |
Generate license with smart detection π | generate license MIT |
gitignore <lang> |
Generate .gitignore file | generate gitignore python |
directory <type> |
Generate project structure | generate directory python |
config <type> |
Generate config files | generate config docker |
<technology> |
Smart append generation | generate electron my-app |
The smart append feature uses intelligent pattern matching to determine what related files should be generated:
Technology | Generated Components |
---|---|
electron |
Directory structure + Node.js gitignore + ESLint + Prettier + VS Code config |
python |
Python project structure + Python gitignore + VS Code config |
react |
React frontend + React gitignore + ESLint + Prettier + VS Code config |
nextjs |
Next.js fullstack + Next.js gitignore + ESLint + Prettier + VS Code config |
fastapi |
FastAPI backend + FastAPI gitignore + Docker config + VS Code config |
microservices |
Microservices structure + Docker + Kubernetes + Monitoring configs |
fullstack |
Next.js + FastAPI + Docker + All development configs |
generate/
βββ generate # Main executable script with smart append
βββ README.md # This file
βββ templates/ # Template files
β βββ gitignore/ # GitIgnore templates
β β βββ python.gitignore
β β βββ node.gitignore
β β βββ react.gitignore
β β βββ electron.gitignore
β β βββ ...
β βββ directory/ # Directory structure templates
β β βββ python/
β β βββ node/
β β βββ electron/
β β βββ ...
β βββ config/ # Configuration templates
β β βββ dockerfile.template
β β βββ eslintrc.template
β β βββ ...
β βββ license/ # License templates π
β βββ MIT.template
β βββ Apache-2.0.template
β βββ BSD-3-Clause.template
β βββ GRIFFIN.template
βββ generators/ # Generator scripts
βββ directory.sh # Directory structure generator
βββ config.sh # Configuration file generator
- Smart Append: Automatically generates related files based on technology
- Intelligent License Generation: Auto-detects names and dates from project context π
- Comprehensive Templates: Covers major programming languages and frameworks
- Intelligent Matching: Flexible pattern matching for technology names
- Context-Aware Detection: Scans project files for author information π
- Multi-Source Date Detection: Analyzes git history and file timestamps π
- Dry Run Mode: Preview what will be generated before creating files
- Modular Design: Separated concerns with dedicated generators
- Extensible: Easy to add new templates and smart mappings
- User-Friendly: Colored output and helpful error messages
- Safe Operations: Prompts before overwriting existing files
generate electron my-desktop-app
cd my-desktop-app
npm install
npm run dev
generate python my-python-project
cd my-python-project
pip install -r requirements.txt
python src/my-python-project/main.py
generate fullstack my-awesome-app
cd my-awesome-app
# Frontend and backend directories created with all configs
# Auto-detect everything from project context
generate license MIT
# Output: Copyright (c) 2020-2025 Griffin Strier
# For a Node.js project with package.json
generate license Apache-2.0
# Automatically uses author from package.json
# For a Python project with pyproject.toml
generate license BSD-3-Clause
# Uses author from pyproject.toml
generate microservices --dry-run
# Shows what would be generated without creating files
generate license MIT --dry-run
# Shows what name and date would be detected
To add new smart append combinations, edit the SMART_MAPPINGS
array in the main generate
script:
# Add to SMART_MAPPINGS in generate/generate
["vue"]="directory:vue-frontend gitignore:node config:eslint config:prettier config:vscode"
["django"]="directory:django-backend gitignore:python config:docker config:vscode"
- Add a new
.gitignore
file intemplates/gitignore/
- Name it
<language>.gitignore
- The template will be automatically available
- Create a new directory in
templates/directory/
- Add template files with
{{PROJECT_NAME}}
placeholders - Update
generators/directory.sh
to handle the new type
- Add template files to
templates/config/
- Use
{{PROJECT_NAME}}
placeholders for substitution - Update
generators/config.sh
to handle the new type
- Add new license template to
templates/license/
- Name it
<LICENSE-NAME>.template
- Use
{{YEAR}}
and{{FULLNAME}}
placeholders - The template will be automatically available
Example license template:
My Custom License
Copyright (c) {{YEAR}} {{FULLNAME}}
[License text here...]
The script is designed to be used as a system-wide command. After creating the symbolic link, you can use generate
from anywhere in your terminal with full smart append functionality.
- Bash shell (version 4.0+ for associative arrays)
- Standard Unix utilities (mkdir, touch, cat, etc.)
- Write permissions for target directories
This tool is part of your custom scripts collection.