← Back to all sparks
C

cli

INFRA · APIS
Velocity0.0

Tools for building attractive command line interfaces in R, with rich text, progress bars and spinners

cli refines terminal output one formatting detail at a time.

rcliterminal-outputformattingdeveloper-experience
Current state
cli builds the formatted terminal output used across r-lib and the tidyverse — inline styles, progress bars, hyperlinks, pluralization. Every release in this window is small and specific: number and byte styles, pluralization that copes with NA and infinities, collapse behaviour that obeys serial comma rules.
Where it's heading
The work splits in two. One half is expressiveness, adding inline style classes for value types packages format constantly. The other is environment compatibility, where cli must work out what the surrounding terminal or IDE actually supports — hyperlink URI generation became configurable rather than fixed, and hyperlinks are disabled where the host renders them badly.
Prediction
Expect more inline style classes and further environment detection work as editors like Positron and RStudio change how they render terminal output.

Recent moves

  1. 4mo ago

    cli 3.6.6 adds inline number and byte formatting styles

    New {.num} and {.bytes} inline styles for formatting numbers and byte sizes. Small additions, but these are values nearly every package prints, and centralising their formatting is how cli keeps output consistent across the ecosystem.

    View source ↗
  2. 1y ago

    cli 3.6.5 handles long strings in code_highlight()

    code_highlight() handles long strings and symbols. A single narrow fix in syntax highlighting.

    View source ↗
  3. 1y ago

    cli 3.6.4 makes hyperlink URIs configurable

    Pluralization stops mishandling NA, NaN and infinities, progress bars accept infinite totals, and the URIs behind .file, .run, .help and .vignette hyperlinks become configurable via options and environment variables. That last one matters for editors that resolve links their own way.

    View source ↗
  4. 2y ago

    cli 3.6.3 builds on ARM Windows, fixes RStudio highlighting

    cli builds on ARM Windows, Solarized Dark becomes the default terminal highlighting theme, and syntax highlighting no longer fails in RStudio when rstudioapi is absent. Platform and host-environment robustness rather than new formatting capability.

    View source ↗
  5. 2y ago

    cli 3.6.2 makes collapsed strings follow serial comma rules

    ansi_collapse() gains a sep2 argument for length-two inputs, defaulting to " and " so collapsed strings follow serial comma rules, and trunc = 1 finally behaves as documented. Typographic detail, which is exactly what this package exists to get right.

    View source ↗
  6. 3y ago

    cli 3.6.1 disables ANSI hyperlinks on the RStudio render plane

    ANSI hyperlinks are switched off on the RStudio render plane, where they did not render correctly. A one-line environment detection fix.

    View source ↗