A cli that aims to managing template code.
pharah-cli aims to managing template code by maintaining a JSON of all template repository.
You could specify a template with owner, repository and branch. Like this:
npm install -g pharah-cli
//In
$ pharah list
//out
╔═══════════════╤═════════════════════╤════════╗
║ Template Name │ Owner/Name │ Branch ║
╟───────────────┼─────────────────────┼────────╢
║ pharah │ ZhaZhengRefn/pharah │ master ║
╚═══════════════╧═════════════════════╧════════╝
$ pharah add
? input the name of this template: pharah
? input the ownerName/repositoryName, such as: tj/commander.js: ZhaZhengRefn/pharah
? input the branch name where this template belongs to: master
╔═══════════════╤═════════════════════╤════════╗
║ Template Name │ Owner/Name │ Branch ║
╟───────────────┼─────────────────────┼────────╢
║ pharah │ ZhaZhengRefn/pharah │ master ║
╚═══════════════╧═════════════════════╧════════╝
$ pharah init
? Which template would you like to use ? pharah
? Input the name of new project. pharah-demo
? Input the path that you want to init the project. /Users/zhazheng/www/my_project
✔ Init the project successfully!
$ pharah delete
? Which template would you want to delete ? pharah
? Deleting a template can not be reverted. Sure? Yes
✔ Writing templates successfully!
╔═══════════════╤════════════╤════════╗
║ Template Name │ Owner/Name │ Branch ║
╚═══════════════╧════════════╧════════╝
$ pharah delete --all
? Delete all templates ? Yes
✔ Writing templates successfully!
╔═══════════════╤════════════╤════════╗
║ Template Name │ Owner/Name │ Branch ║
╚═══════════════╧════════════╧════════╝
$ pharah update
? input the name of the template that you want to update: pharah
? input the ownerName/repositoryName, such as: tj/commander.js: ZhaZhengRefn/pharah
? input the branch name where this template belongs to: develop //here, change the branch name.
✔ Writing templates successfully!
╔═══════════════╤═════════════════════╤═════════╗
║ Template Name │ Owner/Name │ Branch ║
╟───────────────┼─────────────────────┼─────────╢
║ pharah │ ZhaZhengRefn/pharah │ develop ║
╚═══════════════╧═════════════════════╧═════════╝
$ pharah sync
? Url of the template.json: http://www.refn.com/template.json
? Merge or Replace your current template? (Use arrow keys)
❯ merge
replace
You could input pwd
to get the path.
$ pharah exact
? Input the path you want to exact the template.json to. /Users/zhazheng/www/my_project
✔ Writing templates successfully!
╔═══════════════╤═════════════════════╤═════════╗
║ Template Name │ Owner/Name │ Branch ║
╟───────────────┼─────────────────────┼─────────╢
║ pharah │ ZhaZhengRefn/pharah │ develop ║
╚═══════════════╧═════════════════════╧═════════╝