Unboxing is our regular feature where someone at Box UK spends a few hours playing with a new framework, library, tool or technique and blogs about his or her experience.
While browsing through my RSS aggregator the other day I came across a link to a brand new OS terminal application called TermKit, which I thought looked quite neat. As I - unfortunately - spend a lot of time in the Windows shell I thought I'd see if it could be of any use...
What is it?
TermKit aims to be a user-friendly modern alternative to dumb, drab command line clients like Terminal.app on OSX or cmd on Windows. The latter two examples are characterised by their textual interfaces, which can daunt newbies when they are confronted with unintelligible error messages or unintuitive commands. TermKit is instead a glossy, graphical shell which its author, Steven Wittens, believes is more suited to the modern day machines and displays we are accustomed to. The original project is targeted at Mac OSX, although Windows and Linux ports are also in development.
Getting to grips
TermKit is built on some pretty powerful open source projects, namely node.js and Webkit. There are full installation instructions available on the project’s Github page, so I won’t repeat them here, but they’re quite straightforward. I thankfully had many dependencies installed already, including XCode and node.js, on my Macbook. I use Macports, which I recommend for easily installing and maintaining node.js, and many other popular open source tools.
The application is still in an early alpha stage - the author states ‘Nothing works yet’, which while not quite true isn’t far off the mark. I found it a bit fiddly to launch; while it runs in any Webkit-based browser, I chose to test it as a desktop application, which involves first starting up a node.js daemon, then launching the application in a separate process. Presumably this won’t always be necessary, but the approach is probably a little too technical for the sort of user who would get the most out of the app.
Once the app starts up, though, it’s clear to see why the project has been generating such buzz. The interface is lush, about as far away from your bog-standard, 80 character wide, monochromatic, monospaced font terminal as you can imagine. Now, starting to type a command launches an autocomplete pop-up of matching commands, which means less googling for the more esoteric ones. It’s a great way to find commands you never even knew existed, too.
Listing the contents of a folder using ‘ls’ is now so much more appealing:
Through WebKit and node.js's mimetype module TermKit is also able to perform syntax highlighting, which I found to be particularly impressive:
However there’s more to TermKit than just a fancy exterior - the application has been designed to be extensible, with the possibility of replacing each Unix command with a more intuitive, powerful version that takes advantage of this enhanced UI. Steven suggests:
"We should be more pro-active in nudging our users in the right direction, and our tools should be designed for maximum discoverability.
For example, I want to see the relevant part of a man page in a tooltip when I'm typing argument switches. I'd love for dangerous flags to be highlighted in red. I'd love to see regexp hints of possible patterns inline."
It’s clear that Steven appreciates the principal purpose of Unix - singular tools written to perform a single function well - but wishes to build upon that by allowing the tools to connect with the user in a more effective way.
As mentioned earlier, there is plenty still to do. At present I’m unable to run more than one command in a row without the node.js daemon crashing, and there are numerous bugs to be found, like this encoding issue when displaying a manual page:
There’s not much else to play with at the moment - more just enough to whet one’s appetite. As it stands I’m quite happy with Terminal.app on the Mac, though there is certainly room for improvement there; however I see myself eventually getting the most benefit from a Windows port, since the Windows shell hasn’t seen any significant improvement since the days of XP (and perhaps beyond - sadly I don’t have a Windows 95 instance around to check!). I’m discounting Powershell here because it essentially adds enhanced scripting support and does not significantly alter the interface.
Even if ultimately this project doesn’t achieve traction, it serves as a reminder that just because we’ve become accustomed to the appearance of the command line tools we use today, that doesn’t mean they can’t be improved upon. I’d love to see Apple or Microsoft take heed of this and incorporate it, or an equivalent, into their OSs as standard. In the meantime, I shall be keeping an eye on TermKit as it seems very promising indeed.
Want to see more of TermKit?
Those wishing to learn more about TermKit are strongly advised to read Steven’s blog post which explains his motivation for developing the application, and the impressive architecture behind it, in great detail. The comments make interesting reading, too.
If you want to try TermKit for yourself, full instructions for installing it are at its Github page. The page also links to installation details for the Windows and Linux ports for those wishing to experiment with those versions. Further documentation also enables developers to write their own plugins for TermKit, which is something I fancy doing in the future.
Finally, follow TermKit on Twitter for the latest news and updates.