# \[ANN\] console: making OCaml CLI tools look good!

**URL:** <https://discuss.ocaml.org/t/ann-console-making-ocaml-cli-tools-look-good/18671>\
**Category:** Ecosystem\
**Tags:** announce\
**Created:** [November 2, 2026, 10:46am UTC](https://discuss.ocaml.org/t/ann-console-making-ocaml-cli-tools-look-good/18671 "2026-11-02T10:46:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![samoht](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/samoht/32/81_2.png) [@samoht](https://discuss.ocaml.org/u/samoht)\
**Post date:** [November 2, 2026, 10:46am UTC](https://discuss.ocaml.org/t/ann-console-making-ocaml-cli-tools-look-good/18671/1 "2026-11-02T10:46:18Z")

</div>

I’m happy to announce the release of [console 0.9.0](https://github.com/samoht/ocaml-console), a set of widgets for building nice-looking command-line tools. The main design constraint I tried to follow is that the output should look good both for a human at an interactive terminal and for scripts run in CI or other non-interactive loops (like LLM agents). Live rows are redrawn in place and everything useful the program printed is still there when it ends; piped output tries to be relatively clean.

![console-camel](https://us1.discourse-cdn.com/flex020/uploads/ocaml/original/2X/2/21b202a69ab6ff219fa5fee2416d438bbae78d14.gif)

You can use it with:

```auto
opam install console console-eio

```

The widgets in `console` are pure; `console-eio` is the driver that runs animations. There are a few limitation (including limited Windows support) but you can already use it to encode quite complex UX. For instance, here a few imitations of package manager frontends using console (recorded using [k7](https://gazagnaire.org/blog/2026-10-26-k7.html)):

| | |
| --- | --- |
| ![console-opam](https://us1.discourse-cdn.com/flex020/uploads/ocaml/original/2X/b/b18c267eea031cfb770f92fab15f9355882c96d4.gif) | ![console-cargo](https://us1.discourse-cdn.com/flex020/uploads/ocaml/original/2X/e/ed712dd72eba5421dc825b884e0dbb739b2befdc.gif) |
| ![console-docker](https://us1.discourse-cdn.com/flex020/uploads/ocaml/original/2X/d/d7a8c56d42c8430f282e7afa9426bb315b52965f.gif) | ![console-nix](https://us1.discourse-cdn.com/flex020/uploads/ocaml/original/2X/7/7ecc3d918f9968f61a15ef66e563487cd70335ee.gif) |

You can read more (including how it compares with notty, progress and printbox, here): [Thomas Gazagnaire :: console: Making OCaml Command-Line Tools Look Good](https://gazagnaire.org/blog/2026-11-02-console.html).

Feedback is very welcome before 1.0, on the [issue tracker](https://github.com/samoht/ocaml-console/issues) or here.

---

<div class="post-metadata">

**Author:** ![Oh\_Calm](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/oh_calm/32/6235_2.png) [@Oh\_Calm](https://discuss.ocaml.org/u/Oh_Calm)\
**Post date:** [November 5, 2026, 6:31pm UTC](https://discuss.ocaml.org/t/ann-console-making-ocaml-cli-tools-look-good/18671/2 "2026-11-05T18:31:01Z")

</div>

Look pretty cool !

So it’s somewhat like Rust ratatui ?

---

<div class="post-metadata">

**Author:** ![samoht](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/samoht/32/81_2.png) [@samoht](https://discuss.ocaml.org/u/samoht)\
**Post date:** [November 5, 2026, 10:04pm UTC](https://discuss.ocaml.org/t/ann-console-making-ocaml-cli-tools-look-good/18671/3 "2026-11-05T22:04:34Z")

</div>

Not exactly. As far as I understand, ratatui is mostly for full-screen terminal apps: it runs on the [terminal’s alternate screen](https://ratatui.rs/concepts/backends/alternate-screen/); you can’t scroll back when it runs and when the application exits the terminal goes back to where it was before. Ratatui also has an inline mode, but it seems a bit clunky as you have to set a fixed height for your output (I think I heard Rust people prefer `indicatif` for progress bars instead?)

With `console` your program stays a normal command-line tool. Only the lines that changed are redrawn (with the right amount of cursor rewind). You can scroll back, pipe the output to a file and see normal logs in your CI.

---

<div class="post-metadata">

**Author:** ![toastal](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/toastal/32/2944_2.png) [@toastal](https://discuss.ocaml.org/u/toastal)\
**Post date:** [November 8, 2026, 3:40pm UTC](https://discuss.ocaml.org/t/ann-console-making-ocaml-cli-tools-look-good/18671/6 "2026-11-08T15:40:37Z")

</div>

I got console merged into Nixpkgs. [Nixtamal 3.0.0](https://nixtamal.toast.al/changelog/#3.0.0), a Nix input pinner, was just released & is using console to power its TUI/CLI redesign (ditching the horrible, vibecoded old view since I couldn’t be bothered to learn all the ANSI codes & terminal weirdness—biding time for a library that fits the bill). The redrawing is the exact feature I needed.

---

<div class="post-metadata">

**Author:** ![samoht](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/samoht/32/81_2.png) [@samoht](https://discuss.ocaml.org/u/samoht)\
**Post date:** [November 9, 2026, 3:18pm UTC](https://discuss.ocaml.org/t/ann-console-making-ocaml-cli-tools-look-good/18671/7 "2026-11-09T15:18:23Z")

</div>

> When you say only changed lines are redrawn, does that hold up when output like a log line gets appended between live rows, or does that force a full repaint

Normally it should only redraw the lines that changed. If not, that’s a bug I’m happy to try to fix!

> Also curious how the pure widgets and the console-eio driver split responsibilities in practice,

The plan was to have a pure view of the output, with a thin I/O layer for inputs and outputs. But the separation is a quite messy in 0.9.0. I’ve reworked this by adding a second backend to (make this cleaner) and the result is much better: see [lwt: show the progress rows of an Lwt program by samoht · Pull Request #67 · samoht/ocaml-console · GitHub](https://github.com/samoht/ocaml-console/pull/67) for the current WIP. The driver API now just a [few lines](https://github.com/samoht/ocaml-console/tree/console-lwt/lib/lwt) (it doesn’t get deterministic clocks and multi-domain scheduling as the eio backend has, but that’s fine for “normal” use!).

---

<div class="post-metadata">

**Author:** ![samoht](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/samoht/32/81_2.png) [@samoht](https://discuss.ocaml.org/u/samoht)\
**Post date:** [November 18, 2026, 8:44am UTC](https://discuss.ocaml.org/t/ann-console-making-ocaml-cli-tools-look-good/18671/8 "2026-11-18T08:44:24Z")

</div>

I am glad to announce the ([about to be](https://github.com/ocaml/opam-repository/pull/31281)) release of [console 0.10.1](https://github.com/samoht/ocaml-console).

Console is still a library to design beautiful dynamic CLI outputs, with a small collection of active widgets (trees, tables, progress bars, tasks, prompts, etc) that can be styled and composed freely. It aims to be similar in spirit to [Rich](https://github.com/textualize/rich) for python or [indicatif](https://docs.rs/indicatif/latest/indicatif/) for Rust.

The new release comes with a few bug fixes but is focusing on expanding the supported platforms:

- A new package, `console-lwt,` allows to run the exact same widgets using `Lwt` instead of `eio`. This led to cleaning up the API to define new backends which is now becoming somewhat [smaller and better defined](https://github.com/samoht/ocaml-console/blob/main/lib/driver/console_driver.mli).
- Themes are now easier to apply: a new `Theme.set_program` function changes the whole program theme and `console.cli` defines a reusable `--theme` CLI param to try out different themes easily.
- Tasks and Display widget now work properly on multi-domain programs with a limited performance impact and a transparent API. Outputs are queued by domain and routed to the appropriate one (and dropped if flooded).
- Windows is now an officially supported target. For now, the full test suite is running and passing in the CI, but actual positive or negative user reports on Windows would be very welcome! More work on improving this support is planned in the next releases.
- Console 0.10.1 compiles and runs on OxCaml and this is tested in the CI.

Full change logs here:

- [ocaml-console/CHANGES.md at 0.10.0 · samoht/ocaml-console · GitHub](https://github.com/samoht/ocaml-console/blob/0.10.0/CHANGES.md)
- [ocaml-console/CHANGES.md at 0.10.1 · samoht/ocaml-console · GitHub](https://github.com/samoht/ocaml-console/blob/0.10.1/CHANGES.md)

---

<div class="post-metadata">

**Author:** ![blenser4](https://avatars.discourse-cdn.com/v4/letter/b/bbce88/32.png) [@blenser4](https://discuss.ocaml.org/u/blenser4)\
**Post date:** [November 26, 2026, 1:50am UTC](https://discuss.ocaml.org/t/ann-console-making-ocaml-cli-tools-look-good/18671/9 "2026-11-26T01:50:34Z")

</div>

This looks really useful. I have not built a terminal interface before, but the idea of small widgets for progress and spinners makes it sound approachable. The theme support and the Windows support in this release are a nice touch too.
