All Projects → r-lib → Cli

r-lib / Cli

Licence: other
Tools for making beautiful & useful command line interfaces

Programming Languages

r
7636 projects

Labels

Projects that are alternatives of or similar to Cli

Starcli
✨ Browse GitHub trending projects from your command line
Stars: ✭ 269 (-4.95%)
Mutual labels:  cli
Supervizer
NodeJS Application Manager
Stars: ✭ 278 (-1.77%)
Mutual labels:  cli
Dockrails
Simple CLI to Generate and Run a Rails environment with Docker (in Development) !
Stars: ✭ 282 (-0.35%)
Mutual labels:  cli
Pydoc Markdown
Create Python API documentation in Markdown format.
Stars: ✭ 273 (-3.53%)
Mutual labels:  cli
Grumble
A powerful modern CLI and SHELL
Stars: ✭ 277 (-2.12%)
Mutual labels:  cli
Teip
Select partial standard input and replace with the result of another command efficiently
Stars: ✭ 280 (-1.06%)
Mutual labels:  cli
Git Hound
Git plugin that prevents sensitive data from being committed.
Stars: ✭ 269 (-4.95%)
Mutual labels:  cli
Houston
Apple Push Notifications; No Dirigible Required
Stars: ✭ 2,973 (+950.53%)
Mutual labels:  cli
Pycycle
Tool for pinpointing circular imports in Python. Find cyclic imports in any project
Stars: ✭ 278 (-1.77%)
Mutual labels:  cli
Wallace Cli
Pretty CSS analytics on the CLI
Stars: ✭ 281 (-0.71%)
Mutual labels:  cli
Tty Markdown
Convert a markdown document or text into a terminal friendly output.
Stars: ✭ 275 (-2.83%)
Mutual labels:  cli
Sagify
MLOps for AWS SageMaker. www.sagifyml.com
Stars: ✭ 277 (-2.12%)
Mutual labels:  cli
Apizza
Order Dominos pizza from the command line
Stars: ✭ 281 (-0.71%)
Mutual labels:  cli
Onefetch
Git repository summary on your terminal
Stars: ✭ 3,680 (+1200.35%)
Mutual labels:  cli
Progress bar
Command-line progress bars and spinners for Elixir.
Stars: ✭ 281 (-0.71%)
Mutual labels:  cli
Changes
changes automates python library release tasks.
Stars: ✭ 271 (-4.24%)
Mutual labels:  cli
Eiskaltdcpp
File sharing program using DC and ADC protocols
Stars: ✭ 277 (-2.12%)
Mutual labels:  cli
Bruce Cli
A React/Vue application automation build scaffold with zero configuration out of the box
Stars: ✭ 283 (+0%)
Mutual labels:  cli
Doitlive
Because sometimes you need to do it live
Stars: ✭ 3,073 (+985.87%)
Mutual labels:  cli
Expo Github Action
Expo CLI in your GitHub Actions workflow
Stars: ✭ 281 (-0.71%)
Mutual labels:  cli

cli

Helpers for Developing Command Line Interfaces

R build status CRAN RStudio mirror downloads Coverage Status

A suite of tools to build attractive command line interfaces (CLIs), from semantic elements: headers, lists, alerts, paragraphs, etc. Supports theming via a CSS-like language. It also contains a number of lower level CLI elements: rules, boxes, trees, and Unicode symbols with ASCII alternatives. It supports ANSI markup for terminal colors and font styles.


Features

  • Build a CLI using semantic elements: headings, lists, alerts, paragraphs.
  • Theming via a CSS-like language.
  • Terminal colors and font styles.
  • Create cli elements in subprocesses, using the callr package.
  • All cli text can contain interpreted string literals, via the glue package.
  • Support for pluralized messages.

Installation

Install the stable version from CRAN:

install.packages("cli")

Short tour

Some of the more commonly used cli elements, and features.

Short alert messages

One liner messages to inform or warn.

pkgs <- c("foo", "bar", "foobar")
cli_alert_success("Downloaded {length(pkgs)} packages.")
db_url <- "example.com:port"
cli_alert_info("Reopened database {.url {db_url}}.")
cli_alert_warning("Cannot reach GitHub, using local database cache.")
cli_alert_danger("Failed to connect to database.")
cli_alert("A generic alert")

Headings

Three levels of headings.

cli_h1("Heading 1")
cli_h2("Heading 2")
cli_h3("Heading 3")

Lists

Ordered, unordered and description lists, that can be nested.

fun <- function() {
  cli_ol()
  cli_li("Item 1")
  ulid <- cli_ul()
  cli_li("Subitem 1")
  cli_li("Subitem 2")
  cli_end(ulid)
  cli_li("Item 2")
  cli_end()
}
fun()

Themes

Theming via a CSS-like language.

fun <- function() {
  cli_div(theme = list(span.emph = list(color = "orange")))
  cli_text("This is very {.emph important}")
  cli_end()
  cli_text("Back to the {.emph previous theme}")
}
fun()

Command substitution

Automatic command substitution via the glue package.

size <- 123143123
dt <- 1.3454
cli_alert_info(c(
  "Downloaded {prettyunits::pretty_bytes(size)} in ",
  "{prettyunits::pretty_sec(dt)}"))

Pluralization

Pluralization support.

nfiles <- 3
ndirs <- 1
cli_alert_info("Found {nfiles} file{?s} and {ndirs} director{?y/ies}.")

Documentation

See at https://cli.r-lib.org/ and also in the installed package: ?"inline-markup", ?containers, ?themes, ?pluralization.

License

MIT © RStudio

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].