Live data from Hacker News

Vorpal, a framework for building CLIs

vorpal.js.org

11–20 of 43 posts

Re: Vorpal, a framework for building CLIs

#11

If I was making an interactive command line, I think I'd want to do it all in shell. Let's say it's a CLI that interacts with a remote server, then I might have a "script" that "starts" a custom CLI by doing: #!/usr/bin/env bash export REMOTE_ADDR="$1" export PATH="$(dirname $0)/commands:$PATH" export PS1='service:\$ ' bash Now you do something like: $ server-cli https://myservice.com service:$ which upload /path/to/…

True. Though in Node, you can make calls to standard programs, so it can act pretty seamlessly. And there's already a lot of direction towards supporting a lot of familiar methods and more. Like this: https://www.npmjs.com/package/cash

Re: Vorpal, a framework for building CLIs

#12
ah, the javascript developer mindset applied to CLI development.

Start from scratch just because you don't want to read the manual of the right technology, convince lots of people to adopt with a cool site, spend the next 5 years updating your project to get to 10% of the 20yr old projects you ignored.

disclaimer: mostly javascript developer nowadays. but salty.

Re: Vorpal, a framework for building CLIs

#14
post #12

ah, the javascript developer mindset applied to CLI development. Start from scratch just because you don't want to read the manual of the right technology, convince lots of people to adopt with a cool site, spend the next 5 years updating your project to get to 10% of the 20yr old projects you ignored. disclaimer: mostly javascript developer nowadays. but salty.

My problem is with npm and nodejs dependency, for writing CLI, which essentially means you have to install nodejs and is probably only really useful for nodejs developers.

Re: Vorpal, a framework for building CLIs

#15
post #13
post #8

Author of Vorpal here. You can ask me Qs if you'd like.

I see option autocompletion is provided as a service by the framework. What about tab-completion of paths?

Got you covered. Extensions, extensions. Guess I should have advertised that in the site.

https://github.com/vorpaljs/vorpal-autocomplete-fs

Re: Vorpal, a framework for building CLIs

#16
post #14
post #12

ah, the javascript developer mindset applied to CLI development. Start from scratch just because you don't want to read the manual of the right technology, convince lots of people to adopt with a cool site, spend the next 5 years updating your project to get to 10% of the 20yr old projects you ignored. disclaimer: mostly javascript developer nowadays. but salty.

My problem is with npm and nodejs dependency, for writing CLI, which essentially means you have to install nodejs and is probably only really useful for nodejs developers.

I can understand that. Fortunately, Node is becoming huge in terms of CLI - there's a ton of really useful CLI apps for all kinds of things. To the point where it becomes advantageous to have NPM installed, Node developer or not. At that point, installation of a CLI app is easier and more uniform than many other methods. My 0.02.

My purpose in writing Vorpal is to make building CLIs accessible to a wider audience. While haters will hate JS, it nevertheless has a very broad use and accessibility.

Re: Vorpal, a framework for building CLIs

#17
post #11

If I was making an interactive command line, I think I'd want to do it all in shell. Let's say it's a CLI that interacts with a remote server, then I might have a "script" that "starts" a custom CLI by doing: #!/usr/bin/env bash export REMOTE_ADDR="$1" export PATH="$(dirname $0)/commands:$PATH" export PS1='service:\$ ' bash Now you do something like: $ server-cli https://myservice.com service:$ which upload /path/to/…

True. Though in Node, you can make calls to standard programs, so it can act pretty seamlessly. And there's already a lot of direction towards supporting a lot of familiar methods and more. Like this: https://www.npmjs.com/package/cash

npm install cash-ls -g doesn't work....would love to use this

Re: Vorpal, a framework for building CLIs

#18
post #11

If I was making an interactive command line, I think I'd want to do it all in shell. Let's say it's a CLI that interacts with a remote server, then I might have a "script" that "starts" a custom CLI by doing: #!/usr/bin/env bash export REMOTE_ADDR="$1" export PATH="$(dirname $0)/commands:$PATH" export PS1='service:\$ ' bash Now you do something like: $ server-cli https://myservice.com service:$ which upload /path/to/…

True. Though in Node, you can make calls to standard programs, so it can act pretty seamlessly. And there's already a lot of direction towards supporting a lot of familiar methods and more. Like this: https://www.npmjs.com/package/cash

* Cash isn't released yet - that's why there's no GH repo. That's my next pjt :)

Re: Vorpal, a framework for building CLIs

#19
post #8

Author of Vorpal here. You can ask me Qs if you'd like.

I've had a pretty bad time trying to get code coverage with my cli tests. I've ended up using spawn() in my test cases due to most libraries using process.exit() / process.stdout.write() and console.log() (instead of picking one and sticking with it).

How are globals used in the vorpal codebase? Is it going to be easier to write my tests (and actually get code coverage with istanbul working)?

I like the site, and the API overview. The library looks nice!

Re: Vorpal, a framework for building CLIs

#20
post #8

Author of Vorpal here. You can ask me Qs if you'd like.

I've had a pretty bad time trying to get code coverage with my cli tests. I've ended up using spawn() in my test cases due to most libraries using process.exit() / process.stdout.write() and console.log() (instead of picking one and sticking with it). How are globals used in the vorpal codebase? Is it going to be easier to write my tests (and actually get code coverage with istanbul working)? I like the site, and the…

Thanks man!

Yeah, it's got stdout piping methods, etc. which make it easy. It's also got UI manipulation methods so you can simulate user action. I haven't particularly had any trouble writing tests, but really it depends on your use case, which I'm not familiar with.

Post reply on HN