DEV Community

Gsitio
Gsitio

Posted on

hey everybody I have a problem with how to create a cli command for a project with node!who can help me ?

Top comments (4)

Collapse
 
rajat19 profile image
Rajat Srivastava

So what is the problem you are facing ?

Collapse
 
ghazaleh271 profile image
Gsitio

actually i wanna make 4 commands

ive made one of them to create a pure template and the second is clone a repository and then checkout a branch then ask usr to what template of those pure templates wanna choose after that choose a name for a folder that user wanna create on that template then commit and push on that repository that user has cloned.

now i can clone a repo but for the next steps i need your help!

Collapse
 
rajat19 profile image
Rajat Srivastava

did you put some code for it on github ?
so that i can understand better

as per my understanding you want to execute bash commands on node js like cloning a repo, checkout a branch etc.
Please correct if i am wrong

you can use child_process package
Check this article for the same stackoverflow.com/questions/377323...

Collapse
 
zolotarev profile image
Andrew Zolotarev

Use commander npm package.