Lanterna VS Ink

Compare Lanterna vs Ink and see what are their differences.

Lanterna

Java library for creating text-based GUIs (by mabe02)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
Lanterna Ink
19 64
2,192 25,760
- -
7.2 6.4
about 2 months ago 10 days ago
Java TypeScript
GNU Lesser General Public License v3.0 only MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

Lanterna

Posts with mentions or reviews of Lanterna. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-09-07.
  • Textual Web: TUIs for the Web
    9 projects | news.ycombinator.com | 7 Sep 2023
    I wrote a TUI before for work, entirely of my own volition and for my own near-exclusive consumption (it was theoretically for anyone, but I'm the only person who would've had a reason to look at it - we were a fairly silo'd dev shop).

    This is what made me pick TUI over a web UI:

    * no web stack, period. no client/server. no js or html. this simplified the problem dramatically. also, no additional services to babysit.

    * no browser - no certificates, security, auth, etc. It's just unix permissions and ssh.

    * there's something comforting about the constraints of just ASCII/ANSI and curses. No bikeshedding over border widths or radii when it's just you picking among a few characters for the shape. just having less decisions to make speeds things up and helps you focus on what you actually want the UI to be able to do.

    Obviously if your app is just calling APIs anyway, that might be negate some of these bullets about no additional services to babysit etc. In this case, it was running an internal infra app that directly connected to a pg db.

    And what made me pick it over just having a CLI:

    * discoverability - it was a complicated app and while it was all technically exposed via cli flags, having a GUI made it a lot easier to figure out what the right incantation is.

    * richer communication medium that's back-and-forth instead of unidirectional. The TUI is able to fetch a list of e.g. valid IDs and let you pick them with a check-list, instead of you having to go query the db yourself and type them in.

    I consider it one of my greatest victories that my boss was able to use the TUI to recover from an incident without needing to page me while I was on holiday, and he said he barely had to read the docs and felt confident he was getting it right the first time. "I did it while sipping my coffee."

    I used https://github.com/mabe02/lanterna - would recommend. They even have a Swing-based emulation mode for easy development iteration running it from intelliJ.

  • Textual: Rapid Application Development Framework for Python
    7 projects | news.ycombinator.com | 18 Aug 2023
    This looks really cool.

    In the past I used lanterna (https://github.com/mabe02/lanterna/tree/master) to develop a text UI for a critical process at the trading firm I worked at. It was essentially a process that would take updated market data and handle things that changed between the last trading session and today - like symbol renames (PCLN to BKNG), changes to market cap that make it change what "category" it fell into (they were based on market cap and volatility measures etc). Things of that nature, that the realtime system didn't handle but happened too often or were too hairy for us to just handle manually.

    The system had a desktop UI component that was oriented towards use by our trading staff. We didn't really have notion of a "server UI" and the server was headless.

    Nobody at our firm was a frontend developer, just backend, systems and data programmers who occasionally dabbled in frontend. So web UIs were very simplistic or highly specific to their use-case, we had no shared tooling.

    In 2023 with things like create-react-app and whatever next.js does, I probably would've opted for one of those. I could've made another desktop app but I wanted to be able to easily get to this from a shitty ssh connection over tethered 4g when I was on-call. So X11 forwarding and RDP were out. So i looked around for a TUI-builder in the project's language, Java.

    What i really liked about Lanterna was that it had a Swing-based implementation which meant I could easily run it from IntelliJ, and that would let me iterate rapidly, and then in production I could run it in a terminal via SSH directly on the machine the server was on (which had certain advantages).

    I'll keep an eye on this to see if I can think of anything neat to build on it. I still generally don't like web apps because they feel like they take a lot of effort to get something compared to a functionally-equivalent product built in something non-browser-based like a TUI or desktop GUI.

  • What options are there for making GUIs and other visual programs using java?
    2 projects | /r/java | 4 May 2023
    Just to differ what others already mentioned: Lanterna. Pretty retro GUIs just for fun.
  • Library like Python Rich
    2 projects | /r/javahelp | 27 Sep 2022
    Lanterna https://github.com/mabe02/lanterna Has examples for most of the things you're looking for (see links in https://github.com/mabe02/lanterna/blob/master/docs/contents.md)
  • Terminal Design Through Java.
    1 project | /r/java | 14 Sep 2022
  • Nimwave – build TUIs for the terminal, web, and desktop
    2 projects | /r/commandline | 18 Jun 2022
  • How to modify lines in console (Java 8)
    1 project | /r/javahelp | 21 May 2022
    You can use a library such as https://github.com/mabe02/lanterna to do fancy console printing. You could even do full console UIs, but just printing lines and moving the cursor and so on is also possible I think.
  • Aquifer: GUI generator for command line apps
    2 projects | /r/java | 6 May 2022
    There is lanterna for that.
  • Textual in Clojure?
    9 projects | /r/Clojure | 28 Apr 2022
    You can use https://github.com/mabe02/lanterna
  • What are some features necessary in an ASCII-graphics library?
    1 project | /r/roguelikedev | 9 Feb 2022
    Is this just a personal excercise? Because https://github.com/mabe02/lanterna is pretty much what you're talking about and pretty good.

Ink

Posts with mentions or reviews of Ink. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-12.
  • I created a simple CLI tool that helps you code FAST!
    2 projects | dev.to | 12 Mar 2024
    I've always wanted to build a CLI tool, and when I realized that you can build one using React with Ink, I converted my Python script into a CLI tool.
  • Delete git branches in batches
    2 projects | dev.to | 5 Feb 2024
    ⚠️ Git for Windows Terminal is currently not supported, and the tool is limited to ink. We will look for alternatives later. Please use CMD, Vscode terminal's Git... terminal
  • Setup Simple Web UI for Node.js App in Seconds
    2 projects | dev.to | 17 Jan 2024
    There is a good solution for some of those cases - ink. With ink, I can implement text-based UI with knowledge of React, which is neat but there are still some caveats for my usages:
  • Building Reactive CLIs with Ink - React CLI library
    3 projects | dev.to | 3 Nov 2023
    Looks cool, right? Building a similar UI in the terminal without any library would be quite hard, though, thanks to Ink it's almost as easy as building any frontend UI with React.
  • Terminal-like output library for js?
    2 projects | /r/learnjavascript | 26 Jun 2023
    ink?
  • Synchronous File Reading and Writing in Node.js
    1 project | /r/node | 25 Jun 2023
    I'm writing a CLI with ink. Writing async code is important as to not block the rendering and respond to user input. I have a few loading animations that update every 100ms. Synchronous operations can make the animation hang for >500ms, making the animation choppy.
  • Launch HN: Resend (YC W23) – Email API for Developers Using React
    11 projects | news.ycombinator.com | 13 Jun 2023
    You get the comfort of using react components instead of fighting with HTML tables to make your emails look nice. I think it's awesome! It's analog to what ink[0] does with CLI outputs. Sure, you could write fancy CLI outputs in bash, but ink takes the pain out of it and makes it easy.

    [0] https://github.com/vadimdemedes/ink

  • Is Node.js a good way to implement a CLI app with persistence?
    3 projects | /r/node | 2 Jun 2023
    Due to Node's asynchronous behavior, it makes Node great for long-running processes that make a lot of HTTP requests, database calls, and other async ops, like a web server or a REST API. However, if I am making a CLI tool for pretty much personal use only, with very minimal async operations, then blocking the event loop with a synchronous function that will resolve almost immediately will make no difference perceivable to a human brain or have any speed benefits that someone can actually observe (think `fs.readFileSync` or `require('dotenv') of 10 line config file, or a quick embedded db (sqlite) query with only ~100 records. I'm wondering what the best way to implement the database part of the app synchronous. I can read/write to JSON files but it would be tricky because the data is relational, and some complex joins and other data wrangling operations are required (complex to perform in JS but are easy to implement in a SQL statement). It's not important what the operations are, that's not the point of this post. This is mostly a personal project of interest: making this CLI tool completely avoiding any async operations/using no promises. I would like to use node tho, as I said this is just out of interest and I also want to experiment with several CLI libraries such as Ink or Cliffy.
  • Ink: React for interactive command-line apps
    1 project | /r/patient_hackernews | 8 May 2023
  • Make interactive command-line apps with React
    1 project | /r/reactjs | 8 May 2023

What are some alternatives?

When comparing Lanterna and Ink you can also consider the following projects:

CQEngine - Ultra-fast SQL-like queries on Java collections

Commander.js - node.js command-line interfaces made easy

Modern Java - A Guide to Java 8 - Modern Java - A Guide to Java 8

oclif - CLI for generating, building, and releasing oclif CLIs. Built by Salesforce.

jcurses - Java Curses implementation

blessed - A high-level terminal interface library for node.js.

LightAdmin - [PoC] Pluggable CRUD UI library for Java web applications

nestjs-commander - A module for using NestJS to build up CLI applications

Jimfs - An in-memory file system for Java 7+

tui-rs - Build terminal user interfaces and dashboards using Rust

JBake - Java based open source static site/blog generator for developers & designers.

PyLaTeX - A Python library for creating LaTeX files