Sorry, Chrome killed the terminal

author: Krasimir Tsonev 2014-06-04 by Krasimir
in Nodejs
If you enjoy this, share it!

That's right. I'm not using the terminal anymore. Instead of that I'm using Chrome. Yes, the Google's browser. There is an extension called Yez! that connects to a Node.js module via web socket. It executes the shell commands and returns the result. And even works under Windows.

The motivation

There are several reasons behind the development of the extension:

Is it really a terminal?

Yes, it is. What it does is to proxy the shell commands. They are still executed on the same place. The difference is that it is not the terminal that runs them but a Node.js process. And, of course, the Yez! module uses spawn so it sends the command's output directly to the browser once it appears. It doesn't wait for the operation's end to show something. As it happens with exec. (More about managing child process in Node.js could be found here). Checkout the following image. It illustrates how everything works:

 

Yez! Chrome extension

 

As we can see, we are able to navigate through the directories and execute commands. The extension checks if the current directory is a valid Git repository. If yes it shows the current branch and if there are any changed files.

It's also a task runner

When we have an instrument that runs shell commands, it make sense to provide functionality for task executing - running several commands at once. That's not something incredible, but the really valuable thing is that we are doing this from a browser. Also, thankfully to Google, we have access to APIs for controlling programmatically the browser.

The following animated gif shows how we create a task for running Jasmine tests on a project and perform a search in GitHub.

 

Yez! Chrome extension

 

How to get started

Contribution

The project is open source. Feel free to report issues or make pull requests at https://github.com/krasimir/yez.

The truth

Of course, I'm using the good old terminal too. There are some things that could not be achieved with Node.js. Like for example SSH connection to a server or complex piping of commands. However, for the regular tasks I prefer to stick to the extension. There is directories' name autocompletion and few keyboard shortcuts. I'm planning to provide functionality for registering aliases. In other words all those small goodies that will boost my productivity.

 

PS: check out here how to develop Node.js applications by using the extension

Did you enjoy this?
Be sure to check out the other articles in the same category.

blog comments powered by Disqus