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/…
Pretty neat. Just need to remember to restore the environment variables afterwards, especially $PATH.
Vorpal, a framework for building CLIs
31–40 of 43 posts
Re: Vorpal, a framework for building CLIs
#32Earlier quoted context omitted.
But a benefit might be cross-platform compatibility seeing as some OSes don't come with, say, grep out of the box. While you could use the native tools, there could be some benefit to writing your own to do exactly what you want consistently. I don't really disagree with you, but just pointing out there is some benefit to writing one's own CLI.
I think its easier to install cygwin than replace all the command line tools I am used to with Javascript equivalents.
Re: Vorpal, a framework for building CLIs
#33Earlier quoted context omitted.
I guess if you're building a CLI intensive application in node to begin with then this library seems like a pretty nifty way to do it. I've used plenty of CLI tools that don't offer auto-complete where it really would be handy to see.
I suppose so. My big concern is that this will lead of a lot of faux-shells with relatively few syntactic similarities. It's a personal preference, but I'd much prefer my programs (node or otherwise) treat the shell like the first class citizen it is and use it to its fullest extent.
Re: Vorpal, a framework for building CLIs
#34If 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
#35Earlier quoted context omitted.
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. Wh…
I'm yet to encounter those.
Re: Vorpal, a framework for building CLIs
#36Earlier quoted context omitted.
But a benefit might be cross-platform compatibility seeing as some OSes don't come with, say, grep out of the box. While you could use the native tools, there could be some benefit to writing your own to do exactly what you want consistently. I don't really disagree with you, but just pointing out there is some benefit to writing one's own CLI.
I think its easier to install cygwin than replace all the command line tools I am used to with Javascript equivalents.
Re: Vorpal, a framework for building CLIs
#37Actually, a REPL Xerox style is awesome, a pure UNIX style CLI not much.
Re: Vorpal, a framework for building CLIs
#38Earlier quoted context omitted.
But a benefit might be cross-platform compatibility seeing as some OSes don't come with, say, grep out of the box. While you could use the native tools, there could be some benefit to writing your own to do exactly what you want consistently. I don't really disagree with you, but just pointing out there is some benefit to writing one's own CLI.
I think its easier to install cygwin than replace all the command line tools I am used to with Javascript equivalents.
For now I use vagrant all the time when I am on Windows.
Re: Vorpal, a framework for building CLIs
#39Earlier quoted context omitted.
I suppose so. My big concern is that this will lead of a lot of faux-shells with relatively few syntactic similarities. It's a personal preference, but I'd much prefer my programs (node or otherwise) treat the shell like the first class citizen it is and use it to its fullest extent.
* I accidentally downvoted you while trying to upvote.
Re: Vorpal, a framework for building CLIs
#40ah, 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.
But a benefit might be cross-platform compatibility seeing as some OSes don't come with, say, grep out of the box. While you could use the native tools, there could be some benefit to writing your own to do exactly what you want consistently. I don't really disagree with you, but just pointing out there is some benefit to writing one's own CLI.
If you have git installed on your machine you have grep ( windows users) and most of linux command tools.