1.0.7 • Published 6 years ago

pharah-cli v1.0.7

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Pharah

A cli that aims to managing template code. Pharah

Usage

Notice

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: intro

Install

npm install -g pharah-cli

Show all templates

//In
$ pharah list

//out
╔═══════════════╤═════════════════════╤════════╗
║ Template Name │ Owner/Name          │ Branch ║
╟───────────────┼─────────────────────┼────────╢
║ pharah        │ ZhaZhengRefn/pharah │ master ║
╚═══════════════╧═════════════════════╧════════╝

Add an template

$ 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 ║
╚═══════════════╧═════════════════════╧════════╝

Init a new project with the template

$ 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!

Delete a template or all of them

$ 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 ║
╚═══════════════╧════════════╧════════╝

Update a template

$ 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 ║
╚═══════════════╧═════════════════════╧═════════╝

Sync the template list from remote

$ pharah sync

? Url of the template.json:  http://www.refn.com/template.json
? Merge or Replace your current template?  (Use arrow keys)
❯ merge
  replace

Exact the template to a specific path

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 ║
╚═══════════════╧═════════════════════╧═════════╝