A fast and flexible CLI & programmatic tool for creating new projects from local, user, or custom templates.
English | 简体中文
- 🚀 Interactive CLI: Quickly scaffold new projects using an intuitive CLI.
- 📁 Multi-source Search: Discovers templates from built-in directories, home directory (
~/.use-template/templates), workspace (./templates), environment variables (USE_TEMPLATE_DIR), or custom CLI options (-t). - 🔍 Template Inspection: List all available templates with descriptions and source locations.
- ⚡ Smart
.gitignoreFiltering: Automatically respects template.gitignorepatterns when copying. - 🔄 Variable Replacement: Updates
package.jsonname,README.md, and optional global text replacement across source files. - 🛠️ Programmatic API: Full TypeScript support to embed template generation logic into custom tools.
npm install -g @zysam/use-template
# or
pnpm add -g @zysam/use-templateOr run directly using npx:
npx @zysam/use-template createuse-template listuse-template createYou can also specify a custom template directory directly:
use-template create -t /path/to/custom-templatesFor comprehensive guides and references, check out:
- 📖 CLI Usage Guide — Command reference, flags, and interactive prompts.
- 📦 API Reference — Programmatic TypeScript/Node.js API documentation.
- 🛠️ Custom Template Authoring Guide — How to create and structure custom templates.
Templates are discovered in the following order:
- Built-in package templates (
templates/) - User home directory (
~/.use-template/templates) - Local workspace directory (
./templates) - Custom directories in
USE_TEMPLATE_DIRenvironment variable - Custom directory passed via
-t, --template-dir <dir>flag
MIT © zysam