Skip to content

Repository files navigation

@zysam/use-template

A fast and flexible CLI & programmatic tool for creating new projects from local, user, or custom templates.

English | 简体中文


Features

  • 🚀 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 .gitignore Filtering: Automatically respects template .gitignore patterns when copying.
  • 🔄 Variable Replacement: Updates package.json name, README.md, and optional global text replacement across source files.
  • 🛠️ Programmatic API: Full TypeScript support to embed template generation logic into custom tools.

Installation

npm install -g @zysam/use-template
# or
pnpm add -g @zysam/use-template

Or run directly using npx:

npx @zysam/use-template create

Quick Start

List Available Templates

use-template list

Create a New Project

use-template create

You can also specify a custom template directory directly:

use-template create -t /path/to/custom-templates

Documentation

For comprehensive guides and references, check out:


Template Search Locations

Templates are discovered in the following order:

  1. Built-in package templates (templates/)
  2. User home directory (~/.use-template/templates)
  3. Local workspace directory (./templates)
  4. Custom directories in USE_TEMPLATE_DIR environment variable
  5. Custom directory passed via -t, --template-dir <dir> flag

License

MIT © zysam

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages