MyNixOS website logo
Description

Create Rich Command Line Applications.

Create rich command line applications, with colors, headings, lists, alerts, progress bars, etc. It uses CSS for custom themes. This package is now superseded by the 'cli' package. Please use 'cli' instead in new projects.

cliapp

Create Rich Command Line Applications

lifecycle R-CMD-check CRAN RStudio mirror downloads Codecov test coverage

Create rich command line applications, with colors, headings, lists, alerts, progress bars, etc. It uses CSS for theming.


Superseded

This package is superseded, and we focus on the cli package now: https://github.com/r-lib/cli

Installation

Stable version:

install.packages("cliapp")

Development version:

pak::pak("r-lib/cliapp")

Usage

This README uses the simple theme, included in the package, see ?simple_theme().

library(cliapp)
start_app(theme = simple_theme())

Headings

cli_h1(), cli_h2() and cli_h3() create three levels of headings:

cli_h1("Title")
cli_h2("Subtitle")
cli_h3("Subsubtitle")

Text and inline markup

All (non-verbatim) outputted text runs through glue::glue(). In addition to glue interpolation, cliapp also supports inline markup via the {markup text} form. The builtin theme defines inline markup classes, see ?inline-markup.

cli_text("{emph Emphasized text}, {strong Strong} importance.
  A piece of code: {code  sum(a) / length(a)}. Package names:
  {pkg cliapp}, file names: {path /usr/bin/env}, etc.")

Alerts

cli_alert("Generic alert")
cli_alert_danger("Something went horribly wrong")
cli_alert_warning("Better watch out!")
cli_alert_info("About to download 1.4GiB of data.")
cli_alert_success("All downloads finished successfully")

Lists

Ordered, unordered and definition lists, they can be nested. See ?cli_ol(), ?cli_ul(), ?cli_dl() and ?cli_it().

cli_div(theme = list(ol = list("margin-left" = 2)))
cli_ul("one", .close = FALSE)
cli_ol(c("foo", "bar", "foobar"))
cli_it("two")
cli_end()
cli_end()

Progress bars

Progress bars are supported via the progress package.

License

MIT © RStudio.

Metadata

Version

0.1.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows