A powerful CLI tool for creating new projects from templates. This tool helps you quickly scaffold new projects using either built-in templates or your own custom templates.
- 🚀 Create new projects from templates with a simple interactive CLI
- 📁 Support for multiple template locations:
- Built-in templates
- User-specific templates (
~/.use-template/templates
) - Local project templates (
./templates
) - Custom template directories via environment variable
- 🔍 List available templates with descriptions
- ⚡ Skip files specified in .gitignore during template copying
- 💪 Support for template customization
npm install -g @zysam/use-template
use-template list
This command shows all available templates and their locations.
use-template create <template-name>
This interactive command will:
- Show a list of available templates
- Prompt for your new project name
- Create a new project based on the selected template
You can also specify an additional template directory:
use-template create -t /path/to/templates
Templates are searched in the following locations:
- Built-in templates directory
- User's home directory:
~/.use-template/templates
- Local project directory:
./templates
- Custom locations specified in
USE_TEMPLATE_DIR
environment variable
You can set additional template locations using the USE_TEMPLATE_DIR
environment variable:
export USE_TEMPLATE_DIR=/path/to/templates
- Create a new directory in any of the template locations
- Add your template files
- (Optional) Include a
package.json
with a description field to provide template information - Your template will automatically appear in the template list
MIT
Contributions are welcome! Please feel free to submit a Pull Request.