Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Termui – Go terminal dashboard (github.com/gizak)
347 points by wtbob on March 27, 2015 | hide | past | favorite | 66 comments


The author likes terminals a lot: http://gizak.github.io/

Projects like this make me want to have an excuse to use them.


This project makes me want to have an excuse to learn go!


Let me also plug this great little building block that this library is using: http://github.com/nsf/termbox-go


Turns out I recently wrote a dashboard client (quick hack in Ruby, soon converted to Go) for our status monitor app server (in Go, exposes only an API to get the results). The monitor is on Digital Ocean and the dashboard is on premises and runs on ArchLinux (on an old spare machine, soon a RPi because noise and thermal exhaust, and why wwe'll convert the client to Go, to lower overhead as much as possible), switches to vt8 on boot and does its thing straight into tty8. It can also be run locally, is responsive to resize, and triggers notifications via the bell (pcspkr on the dashboard machine, terminal bounce+tab icon on OS X Terminal.app) when something bad happens.

Learning about terminal escape sequences and capabilities (SIGWINCH, alternate screen, doing coloring non naively, clear part/all of line/screen) was quite fun and not that hard.

Going terminal/VT is incredibly interesting for us when building such tools because the setup is extremely simple, robust, secure, and portable.

This package will certainly allow us to go to the next level much more easily.


Using this together with cool-retro-term (https://github.com/Swordfish90/cool-retro-term) produces quite awesome results: http://imgur.com/gallery/i1LtkK7/


Are there other in-terminal applications that have browser-like presentation options like this? Specifically with padding/margin and a "responsive" view?

In short, very, very cool.


There's a node.js implementation of something very similar at https://github.com/yaronn/blessed-contrib


as the second line of the readme said

"Go terminal dashboard. Inspired by [blessed-contrib], but purely in Go."


HN discussion about the Node.JS implementation (blessed-contrib) a couple of months ago:

https://news.ycombinator.com/item?id=8888089


If we want to trace back the lineage completely, here's the discussion on blessed (https://github.com/chjj/blessed):

https://news.ycombinator.com/item?id=6058639

I guess it wasn't very popular in spite of the projects it influenced. :)

Although, blessed-contrib does add some pretty cool widgets.


blessed is an amazing engineering work! I hoped the name blessed-contrib to show the project roots.

termui is built upon termbox-go in a similar way that blessed-contrib builds on blessed, which is why I found them similar.


yaronn, I totally appreciate that. I like seeing projects based on blessed, and yours might be the first major library to do that. The drawille ascii art in blessed-contrib is awesome, and it's good because I think it belongs in a separate library. It might be too specific for blessed core. That being said, I definitely want to add a table widget to blessed eventually. It should be in there.


Awesome, those kind of terminal interface look like what the future would have been according to the scifi movies I watched when I was a kid!


This is pretty cool! Do you guys know if there is a web app that lets you create dashboards like this one?


Well, a popular one is Dashing by Shopify - https://github.com/shopify/dashing


http://event-fabric.com/ (I'm the Co-Founder)

here's an overview video: https://www.youtube.com/watch?v=JyeqgrykNkI


Not sure about web apps, but Status Board (http://panic.com/statusboard/) is an iPad app that lets you create dashboards.


Well, you could go all out, grab https://github.com/chjj/term.js, plug that into termui using WebSockets or something, and it would most likely work:

On the other hand, you can easily code your own without too much hassle. https://github.com/rcarmo/raspi-cluster includes a minimalist Dashing clone with a Go backend and real-time updates.


I'm not sure this is what you mean but, running the charts in a browser won't give you as much uptime as a terminal even if the charts look better.


Delightful! So much information density in so few bytes ..


Why is there text written over other text in the screenshots? It makes everything look broken, cluttered, distracting and difficult to read.


Nice to see this project is progressing since it was last posted. I personally have a similar thing hacked together for some specific server monitoring stuff, would love to someday port all our analytics over to something like this.



It says so in the README.md

> Go terminal dashboard. Inspired by blessed-contrib, but purely in Go.


He calls this out in the repo description.


Any other framework like this in Python or C++?


Python has urwid.


sweet!!

I'd love that htop work with this

ref: http://man.cx/htop


Does the software name come from "tesuji" by any chance? Because that would be very clever :)


I like the visuals and I'm also happy to see a Go project with easy to read real world demo codes.


When I try to run any examples, it just exits with no error.


Very nice. It makes me want to switch to vim as well.


I have images of tty-DOM, is it bad ?


Which terminal emulation do you support?

(1)None (2)Ansi (3)Avatar (4)VT-100 (5)Rip Graphics


I remember those days fondly.. my BBS was still running in 2012 (via telnet), been wanting to find time to get it back online again. Though, RIPScript is kind of a waste artifact at this point, text-mode art is still pretty cool, and seeing a bit of activity.


CSS does specify a tty media type. I've never been able to find an implementation for an actual tty though.


This looks pretty awesome.


That looks amazing.


Oh wow yes please.


Github is going down. I can't access now.


wow looks sweet. will this run inside a tmux session?


[flagged]


I don't think anybody's said anything like that.

You can build awesome software projects using almost any toolset. C, or C++, or Ruby, or Go, or Java, or…

The question is – is the trade-off worth it? Lack of generics makes things more awkward – but it's also simpler, so maybe it's a net gain? Some people think it is, and some people think it's not. But it's a useful conversation to have.


Considering how many cool projects are being written in Go lately, it seems that a lot of people either don't mind the lack of generics or like the rest of Go enough to power through. I'm personally in the latter camp, though I can't say I've written anything remotely as cool as this.


From what I've seen though, most of these projects are executable applications, often with a small code base and written by at most a handful of people. I don't think this is the type of code that really benefits from generics.

As a Scala developer I heavily use generics, but generally only when writing libraries. Application code, code that becomes the final executable and isn't mean to be reused, is usually very light on generics and many other fancier aspects of the type system. Perhaps it goes without saying, but it's only when writing generic code do generics really become important.

To me, Go seems good for one-off projects like this. The code is straightforward and it's small enough that it's not a big deal to hand-write functions that could have been generic. But for large projects or for writing highly reusable code, Go seems really unfit for the job, and I think it's those kinds of projects people have in mind when they criticize Go for not having more powerful features like generics.


Every time I have to write a duplicate XYZServiceResponse instead of ServiceResponse<XYZ>, I don't think "Hey I can't do stuff", I think "I have to copy and paste the same code AGAIN."


Perhaps you should instead be composing an XYZServiceResponse that implements the ServiceResponse interface?


Can't json deserialize things to interface{} and then use members.


Good point - throw in a parent struct type.

http://play.golang.org/p/oASRdqN0eQ


Good pull, but are there really that many use cases in production code where you need to consume JSON that you don't have an expectation of what types of data are coming your way?


if you have a standard ServiceResponse wrapper with meta information and a 'response' field that is the actual contents of the response. Leads to FooServiceResponse, BarServiceResponse vs. if you just have a generic ServiceResponse<T>


Yeah, it's like how all those people cutting trees with a manual saw proved that you don't need a power saw!


Or maybe programming languages aren't like saws at all and your analogy is fundamentally compromised by this. They are tools, but they are there own tools. Good at what they are good at and people are apt to use what feels right. More power to them.


>Good at what they are good at and people are apt to use what feels right. More power to them.

That's just wishy washy "let's everyone use what's best for them" etc.

It's not like there's not something called computer SCIENCE, and PL research, that has studied Generics and what they bring to the table...


You're pretty hilarious. There's no SCIENCE here, there's religious fanaticism on both sides driven by anecdotes from thousands of amateurs. Where's the rigorous study that shows if Go or Haskell is better for building quality software?

These tools don't solve some mythical perfect "math" problem. They solve a "social" problem. We write software to help people. Wether a language has generics or not almost certainly not the most important factor that drives the success or failure of a project. But hey, I haven't done a rigorous study to back that up. At least I can admit that.


Generics are like a power saw? ASM doesn't have generics.


ASM doesn't have much in the way of type restrictions either...


Is there something about generics I'm missing? Other than during discovery, when do you have input that you cannot anticipate its type and you are forced to modify it?


I think you're missing something about generics, yes. Firstly, often you don't know the type you're working with because you're writing a generic library, made to be used generically. Secondly, often you want to write some generic data structures or algorithms and parameterize them over multiple known types, and generics help you avoid repeating yourself but maintain strong static typing.


[flagged]


> How precious. I thought that the novelty of "my website is a terminal" had worn off by now, but oh well.

Gratuitous negativity violates HN's guidelines and is not welcome here. If you have criticisms to make, make them substantively. This is not a site for spewing bile.


>How precious. I thought that the novelty of "my website is a terminal" had worn off by now, but oh well

Whereas the novelty of rude remarks for no real reason keeps on giving!


Well, I never thought that I was an innovating or unique grumpy mofo. ;)


Are you having a bad day?

You are suggesting using screen space for the use case of a new user. Some people optimize for people that are already familiar with the program.

Both are valid options, so it's a bit silly to criticize just because it's not your preferred use case.


Damn it - it seems I mistakingly replied to the whole thread, when I intended to reply to this post:

https://news.ycombinator.com/item?id=9276508


> You are suggesting using screen space for the use case of a new user. Some people optimize for people that are already familiar with the program.

It's a landing page, man. Unless you're a celebrity, you should "optimize for new users".


It’s a personal website, not a landing page (and hosted on a platform that encourages experimenting). I’d argue that in this case not everything needs to be optimized for the new user’s sake.


Ugh, my bad. I don't even know why I thought it was a landing page to begin with. Still, the same argument applies: for a personal website by a non-celebrity (status), it's pointless indirection to have to (for newcomers) explicitly have to ask for how to access other sites, and accessing other sites is the whole point of the website (besides the "novelty"). Oh, that and changing the 'terminals' background colour, I guess.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: