I am creating a cli tool in nodejs, that i want people to be able to run like this:

git clone mytool.git
mytool -arg1

Is it possible, or there needs to be a step in between. What would it be.

  • 1
    Have you explored packaging your software and using standard package management tools, such as rpm or deb? – Wildcard Aug 18 '16 at 22:13
  • using rpm or deb is the real solution but there's no reason cloning a git repo and running the scripts/executables it brings down won't work. It would just be a clunky and unfamiliar way for people to get your software. – Bratchley Aug 19 '16 at 0:34

Since git clone will create a new directory, you will need to either cd to that directory or include it in the command path as mytool/mytool -arg1.

| improve this answer | |

Here is a little script that you can give to your friends who want to use your program:

git clone mytool.git
cd yourproject
./mytool -arg1
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.