Install
$ agentstack add skill-posit-dev-skills-cli ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
CLI for R Packages
When to Use What
task: Display error with context and formatting use: cli_abort() with inline markup and bullet lists
task: Show warning with formatting use: cli_warn() with inline markup
task: Display informative message use: cli_inform() with inline markup
task: Show progress for counted operations use: cli_progress_bar() with total count
task: Show simple progress steps use: cli_progress_step() with status messages
task: Format code or function names use: {.code ...} or {.fn package::function}
task: Format file paths use: {.file path/to/file}
task: Format package names use: {.pkg packagename}
task: Format variable names use: {.var variable_name}
task: Format values use: {.val value}
task: Handle singular/plural text use: {?s} or {?y/ies} with pluralization
task: Create headers use: cli_h1(), cli_h2(), cli_h3()
task: Create alerts use: cli_alert_success(), cli_alert_danger(), cli_alert_warning(), cli_alert_info()
task: Create lists use: cli_ul(), cli_ol(), cli_dl() with cli_li()
Inline Markup Essentials
Use inline markup with {.class content} syntax to format text:
# Basic formatting
cli_text("Function {.fn mean} calculates averages")
cli_text("Install package {.pkg dplyr}")
cli_text("See file {.file ~/.Rprofile}")
cli_text("{.var x} must be numeric, not {.obj_type_of {x}}")
cli_text("Got value {.val {x}}")
# Code formatting
cli_text("Use {.code sum(x, na.rm = TRUE)}")
# Paths and arguments
cli_text("Reading from {.path /data/file.csv}")
cli_text("Set {.arg na.rm} to TRUE")
# Types and classes
cli_text("Object is {.cls data.frame}")
# Emphasis
cli_text("This is {.emph important}")
cli_text("This is {.strong critical}")
# Fields
cli_text("The {.field name} field is required")
Vector Collapsing
Vectors are automatically collapsed with commas and "and":
pkgs Installing packages: dplyr, tidyr, and ggplot2
files Found 2 files: data.csv and script.R
Escaping Braces
Use double braces {{ and }} to escape literal braces:
cli_text("Use {{variable}} syntax in glue")
#> Use {variable} syntax in glue
For complete markup reference: See [references/inline-markup.md](references/inline-markup.md) for all 50+ inline classes, edge cases, nesting rules, and advanced patterns.
Pluralization Basics
Use {?} for pluralization with three patterns:
Single Alternative
nfile Found 1 file
nfile Found 3 files
Two Alternatives
ndir Found 1 directory
ndir Found 5 directories
Three Alternatives (zero/one/many)
nfile Found 0 files: no files
nfile Found 1 file: the file
nfile Found 3 files: the files
Helpers: qty() and no()
Use no() to display "no" instead of zero:
nfile Found no files
Use qty() to set quantity explicitly:
nupd 3/10 files need updates
For advanced pluralization: See [references/inline-markup.md](references/inline-markup.md) for edge cases and complex patterns.
CLI Conditions: Core Patterns
Use cli conditions instead of base R for better formatting:
cli_abort() - Formatted Errors
# Before (base R)
stop("File not found: ", path)
# After (cli)
cli_abort("File {.file {path}} not found")
# With bullets for context
check_file "` - Arrow/pointer
**For advanced error design**: See [references/conditions.md](references/conditions.md) for error design principles, rlang integration, testing strategies, and real-world patterns.
## Basic Progress Indicators
### Simple Progress Steps
```r
process_data % filter(mpg > 20)"
))
# Verbatim text (no formatting)
cli_verbatim("This is displayed exactly as-is: {not interpolated}")
Lists
# Unordered list
cli_ul()
cli_li("First item")
cli_li("Second item")
cli_end()
# Ordered list
cli_ol()
cli_li("First step")
cli_li("Second step")
cli_end()
# Definition list
cli_dl()
cli_li(c(name = "The name field"))
cli_li(c(email = "The email address"))
cli_end()
Common Workflows
Base R to CLI Migration
# Before: Base R error handling
validate_input 0) {
cli_abort(c(
"Required column{?s} missing from data",
"x" = "Missing {length(missing_cols)} column{?s}: {.field {missing_cols}}",
"i" = "Data has {length(actual_cols)} column{?s}: {.field {actual_cols}}",
"i" = "Add the missing column{?s} or check for typos"
))
}
invisible(data)
}
Function with Progress Bar
process_files <- function(files, verbose = TRUE) {
n <- length(files)
if (verbose) {
cli_progress_bar(
format = "Processing {cli::pb_bar} {cli::pb_current}/{cli::pb_total} [{cli::pb_eta}]",
total = n
)
}
results <- vector("list", n)
for (i in seq_along(files)) {
results[[i]] <- process_file(files[[i]])
if (verbose) {
cli_progress_update()
}
}
results
}
Resources & Advanced Topics
Reference Files
- [references/inline-markup.md](references/inline-markup.md) - Complete catalog of inline classes organized by category, advanced patterns, nesting rules, and real-world examples
- [references/conditions.md](references/conditions.md) - Advanced error design patterns, rlang integration, testing with testthat snapshots, migration guide, and anti-patterns
- [references/progress.md](references/progress.md) - Nested progress bars, custom formats, all progress variables, parallel processing, Shiny integration, and debugging
- [references/themes.md](references/themes.md) - Complete theming system with CSS-like selectors, container functions, color palettes, custom themes, and accessibility
- [references/ansi-operations.md](references/ansi-operations.md) - ANSI string operations (align, columns, nchar, etc.), hyperlinks, color detection, testing CLI output, and troubleshooting
External Resources
Related Packages
- rlang - Condition handling and error objects integrate with cli
- glue - String interpolation powers cli's
{}syntax - testthat - Snapshot testing for cli output
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: posit-dev
- Source: posit-dev/skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.