Skip to content

todrfu/cv

Repository files navigation

@cv-cli

  • Release

The global command for cli is: cv

➜  cv -h
Usage: cv [options] [command]

Options:
  -v, --version        output the version number
  -h, --help           display help for command

Commands:
  create|c             create a project
  install|i <pkgName>  install a cv template
  list|ls              list all installed templates
  uninstall|remove     uninstall a cv template
  info                 show information about a template
  update-template|up   update a template to the latest version
  outdated             check for outdated templates
  search               search for templates on npm
  yo|y <projectName>   create cv template
  update               update cv self
  help [command]       display help for command

create

Initialize a project and choose from different project templates. The default template will be downloaded and configured on first use:

  • xxx template

If the desired template is not available, you can choose to install other templates.

✗  cv create
? Please select a template: (Use arrow keys)
  xxx template 
  yyy template 
❯ Don't have the template you want? Install a new template now?

install

Install other templates, supporting both npm packages and git url packages.

The npm package for templates should have the prefix cv-generator-.

cv install cv-generator-pc-xxx

If the project corresponding to the git url is not a yeoman-generator package as specified by this project, it will be forcibly converted to a yeoman-generator package after downloading.

➜  cv install https://github.com/todrfu/xxx.git

# or specify the branch
➜  cv install https://github.com/todrfu/xxx.git#master

list

List all installed templates.

# List all templates
➜  cv list

# Output as JSON
➜  cv list --json

uninstall

Uninstall a template.

# Uninstall a specific template
➜  cv uninstall generator-chrome-extension

# Interactive uninstall
➜  cv uninstall

# Uninstall all templates
➜  cv uninstall --all

info

Show detailed information about a template.

# Show info for a specific template
➜  cv info generator-chrome-extension

# Interactive selection
➜  cv info

update-template

Update a template to the latest version.

# Update a specific template
➜  cv update-template generator-chrome-extension

# Update all templates
➜  cv update-template --all

outdated

Check which templates have updates available.

# Check for outdated templates
➜  cv outdated

# Output as JSON
➜  cv outdated --json

search

Search for templates on npm.

# Search for templates
➜  cv search react

# Show popular templates
➜  cv search --popular

# Output as JSON
➜  cv search react --json

yo

When you need to add template options, you can customize the project template using the cv yo xxx command to initialize a Yeoman project template. Fill in the content as needed.

➜  cv yo test-yo

A folder named generator-test-yo will be created in the current directory, containing the code for creating project templates suitable for cv.

➜ cd generator-test-yo

➜ tree -L 1

.
├── README.md
├── index.js
├── package.json  # The package name must have the prefix cv-generator-
├── questions.js  # Yeoman script, can be adjusted as needed
└── template      # Project template code should be placed in this directory

About

A command-line tool for managing project templates within a team.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors