bc6d800d79cdbb94355c12bd8b92813bc31e1061
Project Scaffold CLI
A CLI tool that generates standardized project scaffolding for multiple languages (Python, Node.js, Go, Rust) with intelligent defaults, auto-generated configs, CI/CD templates, and custom template support.
Features
- Multi-language templates: Pre-built templates for Python, Node.js, Go, and Rust projects
- Interactive prompts: Interactive CLI prompts for project configuration
- Gitignore generation: Auto-generate language-specific .gitignore files based on best practices
- CI/CD templates: Generate CI/CD pipeline templates for GitHub Actions and GitLab CI
- Custom template support: Allow users to create, save, and share custom project templates
- Configuration file: Support project.yaml or .project-scaffoldrc for default configurations
Installation
From PyPI
pip install project-scaffold-cli
From Source
git clone https://7000pct.gitea.bloupla.net/7000pctAUTO/project-scaffold-cli.git
cd project-scaffold-cli
pip install -e .
Quick Start
Generate a Python project
psc create my-python-project --language python
Generate a Node.js project
psc create my-nodejs-project --language nodejs
Generate with CI/CD templates
psc create my-project --language python --ci github
Interactive Mode
psc create
Usage
Commands
create
Create a new project scaffold.
psc create [OPTIONS] [PROJECT_NAME]
Options:
| Option | Description |
|---|---|
-l, --language TEXT |
Project language (python, nodejs, go, rust) |
-a, --author TEXT |
Author name |
-e, --email TEXT |
Author email |
-d, --description TEXT |
Project description |
-L, --license TEXT |
License (MIT, Apache-2.0, GPL-3.0, BSD-3-Clause, None) |
--ci TEXT |
CI/CD provider (github, gitlab, none) |
-t, --template TEXT |
Custom template path or name |
-c, --config FILE |
Path to configuration file |
--yes |
Skip prompts and use defaults |
--force |
Force overwrite existing directory |
template
Manage custom templates.
psc template [OPTIONS] COMMAND [ARGS]...
Subcommands:
list- List all custom templatessave- Save a new custom templatedelete- Delete a custom template
init-config
Generate a template configuration file.
psc init-config --output project.yaml
Configuration
Configuration File (project.yaml)
Create a project.yaml file in your project root:
project:
author: "Your Name"
email: "your.email@example.com"
license: "MIT"
description: "A brief description of your project"
defaults:
language: "python"
ci: "github"
template: null
template_vars:
python:
version: "3.8+"
nodejs:
version: "16+"
User Configuration (~/.config/project-scaffold/config.yaml)
User-level configuration for custom template paths:
template_paths:
- ~/.local/share/project-scaffold/templates
custom_templates_dir: ~/.config/project-scaffold/templates
Supported Languages
| Language | Files Generated |
|---|---|
| Python | setup.py, requirements.txt, README.md, init.py, cli.py, test_main.py |
| Node.js | package.json, index.js, README.md |
| Go | go.mod, main.go, README.md |
| Rust | Cargo.toml, src/main.rs, README.md |
Custom Templates
Creating Custom Templates
- Create a template directory with your project structure
- Use Jinja2 syntax for variables:
{{ project_name }} - Save the template using
psc template save
Template Variables
Available variables for all templates:
{{ project_name }}- Project directory name{{ project_slug }}- kebab-case project name{{ author }}- Author name{{ email }}- Author email{{ description }}- Project description{{ license }}- License name{{ year }}- Current year{{ language }}- Programming language
CI/CD Support
GitHub Actions
Generate .github/workflows/ci.yml with:
- Linting
- Testing
- Code coverage
GitLab CI
Generate .gitlab-ci.yml with:
- Build stages
- Test jobs
- Deployment steps
Project Structure
project-scaffold-cli/
├── project_scaffold_cli/
│ ├── __init__.py
│ ├── cli.py # Main CLI interface
│ ├── template_engine.py # Jinja2 template rendering
│ ├── config.py # Configuration handling
│ ├── prompts.py # Interactive prompts
│ ├── gitignore.py # .gitignore generation
│ └── templates/ # Built-in templates
│ ├── python/
│ ├── nodejs/
│ ├── go/
│ ├── rust/
│ └── ci/
├── tests/ # Test suite
├── docs/ # Documentation
├── setup.py
├── setup.cfg
├── requirements.txt
├── requirements-dev.txt
└── README.md
Development
Setting up Development Environment
git clone https://7000pct.gitea.bloupla.net/7000pctAUTO/project-scaffold-cli.git
cd project-scaffold-cli
pip install -e ".[dev]"
Running Tests
pytest -v --cov=project_scaffold_cli --cov-report=term-missing
Code Formatting
ruff check --fix .
Contributing
Contributions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.