a text tool that saves you time and helps your team build new files with consistency.
- Download from release
- Install by
npm
npm i -g @tonyer/cg
# other package manager
yarn add -g @tonyer/cg
pnpm add -g @tonyer/cg
- Add
template
cd examples
# add a template to user path
cg add base
# as new name
cg add base test
- Use
Template name
# use template to generate
cg g base --name Tom --age 12
cg g test --name Job --age 44
- Use
Template path
# use template to generate
cg g --template=examples/base --params="name=Tom&age=12"
cg g --template=examples/test --params="name=Tom&age=12"
- Add
template
repo
# clone template repo
cg clone https://github.com/MQpeng/cg-templates
- fetch
template
repo
# pull template repo
cg pull