cli: Helpers for Developing Command Line Interfaces (original) (raw)

Align an ANSI colored string

ansi_align

Collapse a vector into a string scalar

ansi_collapse

Format a character vector in multiple columns

ansi_columns

Like 'base::grep()' and 'base::grepl()', but for ANSI strings

ansi_grep ansi_grepl

Check if a string has some ANSI styling

ansi_has_any

Hide/show cursor in a terminal

ansi_hide_cursor ansi_show_cursor ansi_with_hidden_cursor

Convert ANSI styled text to HTML

ansi_html

CSS styles for the output of 'ansi_html()'

ansi_html_style

Count number of characters in an ANSI colored string

ansi_nchar

Like 'base::nzchar()', but for ANSI strings

ansi_nzchar

Perl compatible regular expression that matches ANSI escape sequences

ansi_regex

Simplify ANSI styling tags

ansi_simplify

Labels a character vector as containing ANSI control codes.

ansi_string

Remove ANSI escape sequences from a string

ansi_strip

Split an ANSI colored string

ansi_strsplit

Truncate an ANSI string

ansi_strtrim

Wrap an ANSI styled string to a certain width

ansi_strwrap

Substring(s) of an ANSI colored string

ansi_substr

Substring(s) of an ANSI colored string

ansi_substring

ANSI character translation and case folding

ansi_chartr ansi_tolower ansi_toupper

Remove leading and/or trailing whitespace from an ANSI string

ansi_trimws

ANSI colored text

ansi-styles bg_black bg_blue bg_br_black bg_br_blue bg_br_cyan bg_br_green bg_br_magenta bg_br_red bg_br_white bg_br_yellow bg_cyan bg_green bg_magenta bg_none bg_red bg_white bg_yellow col_black col_blue col_br_black col_br_blue col_br_cyan col_br_green col_br_magenta col_br_red col_br_white col_br_yellow col_cyan col_green col_grey col_magenta col_none col_red col_silver col_white col_yellow style_blurred style_bold style_dim style_hidden style_inverse style_italic style_no_bg_color style_no_blurred style_no_bold style_no_color style_no_dim style_no_hidden style_no_inverse style_no_italic style_no_strikethrough style_no_underline style_reset style_strikethrough style_underline

The built-in CLI theme

builtin_theme

'cat()' helpers

cat_boxx cat_bullet cat_line cat_print cat_rule

Compose multiple cli functions

cli

Signal an error, warning or message with a cli formatted message

cli_abort cli_inform cli_warn

CLI alerts

cli_alert cli_alert_danger cli_alert_info cli_alert_success cli_alert_warning

CLI block quote

cli_blockquote

List of items

cli_bullets

List of verbatim items

cli_bullets_raw format_bullets_raw

A block of code

cli_code

Debug cli internals

cli_debug_doc

Generic CLI container

cli_div

Definition list

cli_dl

Close a CLI container

cli_end

Capture the output of cli functions instead of printing it

cli_fmt

Format a value for printing

cli_format cli_format.character cli_format.default cli_format.numeric

Create a format method for an object using cli tools

cli_format_method

CLI headings

cli_h1 cli_h2 cli_h3

CLI list item(s)

cli_li

List the currently active themes

cli_list_themes

Ordered CLI list

cli_ol

The connection option that cli would use

cli_output_connection

CLI paragraph

cli_par

Indicate the start and termination of some computation in the status bar (superseded)

cli_process_done cli_process_failed cli_process_start

Add a progress bar to a mapping function or for loop

cli_progress_along

cli progress bars

ccli_tick_reset cli_progress_bar cli_progress_done cli_progress_update cli_tick_reset ticking __cli_update_due

cli progress handlers

cli_progress_builtin_handlers

cli progress bar demo

cli_progress_demo

Simplified cli progress messages

cli_progress_message

Progress bar utility functions.

cli_progress_cleanup cli_progress_num

Add text output to a progress bar

cli_progress_output

Simplified cli progress messages, with styling

cli_progress_step

List of built-in cli progress styles

cli_progress_styles

CLI horizontal rule

cli_rule

cli situation report

cli_sitrep

Update the status bar (superseded)

cli_status

Clear the status bar (superseded)

cli_status_clear

Update the status bar (superseded)

cli_status_update

CLI text

cli_text

Unordered CLI list

cli_ul

Add custom cli style to a vector

cli_vec

CLI verbatim text

cli_verbatim

cli environment variables and options

cli-config

Syntax highlight R code

code_highlight

Syntax highlighting themes

code_theme_list

Combine two or more ANSI styles

combine_ansi_styles

Determine the width of the console

console_width

About cli containers

containers

Show a demo of some (by default all) spinners

demo_spinners

Compare two character vectors elementwise

diff_chr

Compare two character strings, character by character

diff_str

Frequently Asked Questions

faq

Format an error, warning or diagnostic message

format_error format_message format_warning

Format and returns a line of text

format_inline

Character vector to put a spinner on the screen

get_spinner

Check if the current platform/terminal supports reading single keys.

has_keypress_support

Adjective-animal hash

hash_animal hash_obj_animal hash_raw_animal

Emoji hash

hash_emoji hash_obj_emoji hash_raw_emoji

MD5 hash

hash_file_md5 hash_md5 hash_obj_md5 hash_raw_md5

SHA-1 hash

hash_file_sha1 hash_obj_sha1 hash_raw_sha1 hash_sha1

SHA-256 hash

hash_file_sha256 hash_obj_sha256 hash_raw_sha256 hash_sha256

xxHash

hash_file_xxhash hash_file_xxhash64 hash_obj_xxhash hash_obj_xxhash64 hash_raw_xxhash hash_raw_xxhash64 hash_xxhash hash_xxhash64

About inline markup in the semantic cli

inline-markup

Detect if a stream support ANSI escape characters

is_ansi_tty

Detect whether a stream supports \\r (Carriage return)

is_dynamic_tty

Whether cli is emitting UTF-8 characters

is_utf8_output

Read a single keypress at the terminal

keypress

cli hyperlinks

links

Draw a banner-like box in the console

boxx list_border_styles

List all available spinners

list_spinners

Create a new ANSI style

make_ansi_style

Create a spinner

make_spinner

Pluralization helper functions

no qty

Detect the number of ANSI colors to use

detect_tty_colors num_ansi_colors

About cli pluralization

pluralization

String templating with pluralization

pluralize

Turn on pretty-printing functions at the R console

pretty_print_code

The cli progress C API

progress-c

Progress bar variables

cli__pb_bar cli__pb_current cli__pb_current_bytes cli__pb_elapsed cli__pb_elapsed_clock cli__pb_elapsed_raw cli__pb_eta cli__pb_eta_raw cli__pb_eta_str cli__pb_extra cli__pb_id cli__pb_name cli__pb_percent cli__pb_pid cli__pb_rate cli__pb_rate_bytes cli__pb_rate_raw cli__pb_spin cli__pb_status cli__pb_timestamp cli__pb_total cli__pb_total_bytes pb_bar pb_current pb_current_bytes pb_elapsed pb_elapsed_clock pb_elapsed_raw pb_eta pb_eta_raw pb_eta_str pb_extra pb_id pb_name pb_percent pb_pid pb_rate pb_rate_bytes pb_rate_raw pb_spin pb_status pb_timestamp pb_total pb_total_bytes progress-variables

Make a rule with one or two text labels

rule

Print the helpful ruler to the screen

ruler

A simple CLI theme

simple_theme

Draw a sparkline bar graph with unicode block characters

spark_bar

Draw a sparkline line graph with Braille characters.

spark_line

Start, stop, query the default cli application

default_app start_app stop_app

Terminal Hyperlinks

ansi_has_hyperlink_support ansi_hyperlink_types style_hyperlink

Various handy symbols to use in a command line UI

list_symbols symbol

Test cli output with testthat

test_that_cli

About cli themes

themes

Draw a tree

tree

ANSI colors palettes

ansi_palettes ansi_palette_show truecolor

Break an UTF-8 character vector into grapheme clusters

utf8_graphemes

Count the number of characters in a character vector

utf8_nchar

Substring of an UTF-8 string

utf8_substr

Simulate (a subset of) a VT-5xx ANSI terminal

vt_output