[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7350DKRVSQJS3H7S9S2DV7F":3,"skill-same:01M7350DKRVSQJS3H7S9S2DV7F":76},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":38,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":40,"install":41,"resources":53},"01M7350DKRVSQJS3H7S9S2DV7F","cli",null,"R command-line interface styling and semantic messaging.","Morrison-Lab\u002Fai-config","Morrison-Lab","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F104235520?v=4","01M734G0451S2G35MN4HFQK7XP","Morrison Lab","01M734G059BYFDFQA8YTPDGPMH",4,"MIT","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fcli\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: cli\ndescription: R command-line interface styling and semantic messaging.\nuser-invocable: true\nallowed-tools:\n  - Read\n  - Edit\n  - Write\n  - Bash\nmetadata:\n  author: Garrick Aden-Buie (@gadenbuie)\n  version: \"1.0\"\nlicense: MIT\n---\n\n# CLI for R Packages\n\n## When to Use What\n\ntask: Display error with context and formatting use: `cli_abort()` with inline markup and bullet lists\n\ntask: Show warning with formatting use: `cli_warn()` with inline markup\n\ntask: Display informative message use: `cli_inform()` with inline markup\n\ntask: Show progress for counted operations use: `cli_progress_bar()` with total count\n\ntask: Show simple progress steps use: `cli_progress_step()` with status messages\n\ntask: Format code or function names use: `{.code ...}` or `{.fn package::function}`\n\ntask: Format file paths use: `{.file path\u002Fto\u002Ffile}`\n\ntask: Format package names use: `{.pkg packagename}`\n\ntask: Format variable names use: `{.var variable_name}`\n\ntask: Format values use: `{.val value}`\n\ntask: Handle singular\u002Fplural text use: `{?s}` or `{?y\u002Fies}` with pluralization\n\ntask: Create headers use: `cli_h1()`, `cli_h2()`, `cli_h3()`\n\ntask: Create alerts use: `cli_alert_success()`, `cli_alert_danger()`, `cli_alert_warning()`, `cli_alert_info()`\n\ntask: Create lists use: `cli_ul()`, `cli_ol()`, `cli_dl()` with `cli_li()`\n\n## Inline Markup Essentials\n\nUse inline markup with `{.class content}` syntax to format text:\n\n```r\n# Basic formatting\ncli_text(\"Function {.fn mean} calculates averages\")\ncli_text(\"Install package {.pkg dplyr}\")\ncli_text(\"See file {.file ~\u002F.Rprofile}\")\ncli_text(\"{.var x} must be numeric, not {.obj_type_of {x}}\")\ncli_text(\"Got value {.val {x}}\")\n\n# Code formatting\ncli_text(\"Use {.code sum(x, na.rm = TRUE)}\")\n\n# Paths and arguments\ncli_text(\"Reading from {.path \u002Fdata\u002Ffile.csv}\")\ncli_text(\"Set {.arg na.rm} to TRUE\")\n\n# Types and classes\ncli_text(\"Object is {.cls data.frame}\")\n\n# Emphasis\ncli_text(\"This is {.emph important}\")\ncli_text(\"This is {.strong critical}\")\n\n# Fields\ncli_text(\"The {.field name} field is required\")\n```\n\n### Vector Collapsing\n\nVectors are automatically collapsed with commas and \"and\":\n\n```r\npkgs \u003C- c(\"dplyr\", \"tidyr\", \"ggplot2\")\ncli_text(\"Installing packages: {.pkg {pkgs}}\")\n#> Installing packages: dplyr, tidyr, and ggplot2\n\nfiles \u003C- c(\"data.csv\", \"script.R\")\ncli_text(\"Found {length(files)} file{?s}: {.file {files}}\")\n#> Found 2 files: data.csv and script.R\n```\n\n### Escaping Braces\n\nUse double braces `{{` and `}}` to escape literal braces:\n\n```r\ncli_text(\"Use {{variable}} syntax in glue\")\n#> Use {variable} syntax in glue\n```\n\n**For complete markup reference**: See [references\u002Finline-markup.md](references\u002Finline-markup.md) for all 50+ inline classes, edge cases, nesting rules, and advanced patterns.\n\n## Pluralization Basics\n\nUse `{?}` for pluralization with three patterns:\n\n### Single Alternative\n\n```r\nnfile \u003C- 1\ncli_text(\"Found {nfile} file{?s}\")\n#> Found 1 file\n\nnfile \u003C- 3\ncli_text(\"Found {nfile} file{?s}\")\n#> Found 3 files\n```\n\n### Two Alternatives\n\n```r\nndir \u003C- 1\ncli_text(\"Found {ndir} director{?y\u002Fies}\")\n#> Found 1 directory\n\nndir \u003C- 5\ncli_text(\"Found {ndir} director{?y\u002Fies}\")\n#> Found 5 directories\n```\n\n### Three Alternatives (zero\u002Fone\u002Fmany)\n\n```r\nnfile \u003C- 0\ncli_text(\"Found {nfile} file{?s}: {?no\u002Fthe\u002Fthe} file{?s}\")\n#> Found 0 files: no files\n\nnfile \u003C- 1\ncli_text(\"Found {nfile} file{?s}: {?no\u002Fthe\u002Fthe} file{?s}\")\n#> Found 1 file: the file\n\nnfile \u003C- 3\ncli_text(\"Found {nfile} file{?s}: {?no\u002Fthe\u002Fthe} file{?s}\")\n#> Found 3 files: the files\n```\n\n### Helpers: qty() and no()\n\nUse `no()` to display \"no\" instead of zero:\n\n```r\nnfile \u003C- 0\ncli_text(\"Found {no(nfile)} file{?s}\")\n#> Found no files\n```\n\nUse `qty()` to set quantity explicitly:\n\n```r\nnupd \u003C- 3\nntotal \u003C- 10\ncli_text(\"{nupd}\u002F{ntotal} {qty(nupd)} file{?s} {?needs\u002Fneed} updates\")\n#> 3\u002F10 files need updates\n```\n\n**For advanced pluralization**: See [references\u002Finline-markup.md](references\u002Finline-markup.md) for edge cases and complex patterns.\n\n## CLI Conditions: Core Patterns\n\nUse cli conditions instead of base R for better formatting:\n\n### cli_abort() - Formatted Errors\n\n```r\n# Before (base R)\nstop(\"File not found: \", path)\n\n# After (cli)\ncli_abort(\"File {.file {path}} not found\")\n\n# With bullets for context\ncheck_file \u003C- function(path) {\n  if (!file.exists(path)) {\n    cli_abort(c(\n      \"File not found\",\n      \"x\" = \"Cannot read {.file {path}}\",\n      \"i\" = \"Check that the file exists\"\n    ))\n  }\n}\n```\n\n### cli_warn() - Formatted Warnings\n\n```r\n# Before (base R)\nwarning(\"Column \", col, \" has missing values\")\n\n# After (cli)\ncli_warn(\"Column {.field {col}} has missing values\")\n\n# With context\ncli_warn(c(\n  \"Data quality issues detected\",\n  \"!\" = \"Column {.field {col}} has {n_missing} missing value{?s}\",\n  \"i\" = \"Consider using {.fn tidyr::drop_na}\"\n))\n```\n\n### cli_inform() - Formatted Messages\n\n```r\n# Before (base R)\nmessage(\"Processing \", n, \" files\")\n\n# After (cli)\ncli_inform(\"Processing {n} file{?s}\")\n\n# With structure\ncli_inform(c(\n  \"v\" = \"Successfully loaded {.pkg dplyr}\",\n  \"i\" = \"Version {packageVersion('dplyr')}\"\n))\n```\n\n### Bullet Types\n\n- `\"x\"` - Error\u002Fproblem (red X)\n- `\"!\"` - Warning (yellow !)\n- `\"i\"` - Information (blue i)\n- `\"v\"` - Success (green checkmark)\n- `\"*\"` - Bullet point\n- `\">\"` - Arrow\u002Fpointer\n\n**For advanced error design**: See [references\u002Fconditions.md](references\u002Fconditions.md) for error design principles, rlang integration, testing strategies, and real-world patterns.\n\n## Basic Progress Indicators\n\n### Simple Progress Steps\n\n```r\nprocess_data \u003C- function() {\n  cli_progress_step(\"Loading data\")\n  data \u003C- load_data()\n\n  cli_progress_step(\"Cleaning data\")\n  clean \u003C- clean_data(data)\n\n  cli_progress_step(\"Analyzing data\")\n  analyze(clean)\n}\n```\n\n### Basic Progress Bar\n\n```r\nprocess_files \u003C- function(files) {\n  cli_progress_bar(\"Processing files\", total = length(files))\n\n  for (file in files) {\n    process_file(file)\n    cli_progress_update()\n  }\n}\n```\n\n### Auto-Cleanup\n\nProgress bars auto-close when the function exits:\n\n```r\nprocess \u003C- function() {\n  cli_progress_bar(\"Working\", total = 100)\n  for (i in 1:100) {\n    Sys.sleep(0.01)\n    cli_progress_update()\n  }\n  # No need to call cli_progress_done() - auto-closes\n}\n```\n\n**For advanced progress**: See [references\u002Fprogress.md](references\u002Fprogress.md) for nested progress, custom formats, parallel processing, all progress variables, and Shiny integration.\n\n## Semantic CLI Elements\n\n### Headers\n\n```r\ncli_h1(\"Main Section\")\ncli_h2(\"Subsection\")\ncli_h3(\"Detail\")\n```\n\n### Alerts\n\n```r\ncli_alert_success(\"Operation completed successfully\")\ncli_alert_danger(\"Critical error occurred\")\ncli_alert_warning(\"Potential issue detected\")\ncli_alert_info(\"Additional information available\")\n```\n\n### Text and Code\n\n```r\n# Regular text with markup\ncli_text(\"This is formatted text with {.emph emphasis}\")\n\n# Code blocks\ncli_code(c(\n  \"library(dplyr)\",\n  \"mtcars %>% filter(mpg > 20)\"\n))\n\n# Verbatim text (no formatting)\ncli_verbatim(\"This is displayed exactly as-is: {not interpolated}\")\n```\n\n### Lists\n\n```r\n# Unordered list\ncli_ul()\ncli_li(\"First item\")\ncli_li(\"Second item\")\ncli_end()\n\n# Ordered list\ncli_ol()\ncli_li(\"First step\")\ncli_li(\"Second step\")\ncli_end()\n\n# Definition list\ncli_dl()\ncli_li(c(name = \"The name field\"))\ncli_li(c(email = \"The email address\"))\ncli_end()\n```\n\n## Common Workflows\n\n### Base R to CLI Migration\n\n```r\n# Before: Base R error handling\nvalidate_input \u003C- function(x, y) {\n  if (!is.numeric(x)) {\n    stop(\"x must be numeric\")\n  }\n  if (length(y) == 0) {\n    stop(\"y cannot be empty\")\n  }\n  if (length(x) != length(y)) {\n    stop(\"x and y must have the same length\")\n  }\n}\n\n# After: CLI error handling\nvalidate_input \u003C- function(x, y) {\n  if (!is.numeric(x)) {\n    cli_abort(c(\n      \"{.arg x} must be numeric\",\n      \"x\" = \"You supplied a {.cls {class(x)}} vector\",\n      \"i\" = \"Use {.fn as.numeric} to convert\"\n    ))\n  }\n\n  if (length(y) == 0) {\n    cli_abort(c(\n      \"{.arg y} cannot be empty\",\n      \"i\" = \"Provide at least one element\"\n    ))\n  }\n\n  if (length(x) != length(y)) {\n    cli_abort(c(\n      \"{.arg x} and {.arg y} must have the same length\",\n      \"x\" = \"{.arg x} has length {length(x)}\",\n      \"x\" = \"{.arg y} has length {length(y)}\"\n    ))\n  }\n}\n```\n\n### Error Message with Rich Context\n\n```r\ncheck_required_columns \u003C- function(data, required_cols) {\n  actual_cols \u003C- names(data)\n  missing_cols \u003C- setdiff(required_cols, actual_cols)\n\n  if (length(missing_cols) > 0) {\n    cli_abort(c(\n      \"Required column{?s} missing from data\",\n      \"x\" = \"Missing {length(missing_cols)} column{?s}: {.field {missing_cols}}\",\n      \"i\" = \"Data has {length(actual_cols)} column{?s}: {.field {actual_cols}}\",\n      \"i\" = \"Add the missing column{?s} or check for typos\"\n    ))\n  }\n\n  invisible(data)\n}\n```\n\n### Function with Progress Bar\n\n```r\nprocess_files \u003C- function(files, verbose = TRUE) {\n  n \u003C- length(files)\n\n  if (verbose) {\n    cli_progress_bar(\n      format = \"Processing {cli::pb_bar} {cli::pb_current}\u002F{cli::pb_total} [{cli::pb_eta}]\",\n      total = n\n    )\n  }\n\n  results \u003C- vector(\"list\", n)\n\n  for (i in seq_along(files)) {\n    results[[i]] \u003C- process_file(files[[i]])\n\n    if (verbose) {\n      cli_progress_update()\n    }\n  }\n\n  results\n}\n```\n\n## Resources & Advanced Topics\n\n### Reference Files\n\n- **[references\u002Finline-markup.md](references\u002Finline-markup.md)** - Complete catalog of inline classes organized by category, advanced patterns, nesting rules, and real-world examples\n\n- **[references\u002Fconditions.md](references\u002Fconditions.md)** - Advanced error design patterns, rlang integration, testing with testthat snapshots, migration guide, and anti-patterns\n\n- **[references\u002Fprogress.md](references\u002Fprogress.md)** - Nested progress bars, custom formats, all progress variables, parallel processing, Shiny integration, and debugging\n\n- **[references\u002Fthemes.md](references\u002Fthemes.md)** - Complete theming system with CSS-like selectors, container functions, color palettes, custom themes, and accessibility\n\n- **[references\u002Fansi-operations.md](references\u002Fansi-operations.md)** - ANSI string operations (align, columns, nchar, etc.), hyperlinks, color detection, testing CLI output, and troubleshooting\n\n### External Resources\n\n- [cli package documentation](https:\u002F\u002Fcli.r-lib.org)\n- [cli GitHub repository](https:\u002F\u002Fgithub.com\u002Fr-lib\u002Fcli)\n- [Building a semantic CLI (article)](https:\u002F\u002Fcli.r-lib.org\u002Farticles\u002Fsemantic-cli.html)\n\n### Related Packages\n\n- **rlang** - Condition handling and error objects integrate with cli\n- **glue** - String interpolation powers cli's `{}` syntax\n- **testthat** - Snapshot testing for cli output\n","# CLI for R Packages\n\n## When to Use What\n\ntask: Display error with context and formatting use: `cli_abort()` with inline markup and bullet lists\n\ntask: Show warning with formatting use: `cli_warn()` with inline markup\n\ntask: Display informative message use: `cli_inform()` with inline markup\n\ntask: Show progress for counted operations use: `cli_progress_bar()` with total count\n\ntask: Show simple progress steps use: `cli_progress_step()` with status messages\n\ntask: Format code or function names use: `{.code ...}` or `{.fn package::function}`\n\ntask: Format file paths use: `{.file path\u002Fto\u002Ffile}`\n\ntask: Format package names use: `{.pkg packagename}`\n\ntask: Format variable names use: `{.var variable_name}`\n\ntask: Format values use: `{.val value}`\n\ntask: Handle singular\u002Fplural text use: `{?s}` or `{?y\u002Fies}` with pluralization\n\ntask: Create headers use: `cli_h1()`, `cli_h2()`, `cli_h3()`\n\ntask: Create alerts use: `cli_alert_success()`, `cli_alert_danger()`, `cli_alert_warning()`, `cli_alert_info()`\n\ntask: Create lists use: `cli_ul()`, `cli_ol()`, `cli_dl()` with `cli_li()`\n\n## Inline Markup Essentials\n\nUse inline markup with `{.class content}` syntax to format text:\n\n```r\n# Basic formatting\ncli_text(\"Function {.fn mean} calculates averages\")\ncli_text(\"Install package {.pkg dplyr}\")\ncli_text(\"See file {.file ~\u002F.Rprofile}\")\ncli_text(\"{.var x} must be numeric, not {.obj_type_of {x}}\")\ncli_text(\"Got value {.val {x}}\")\n\n# Code formatting\ncli_text(\"Use {.code sum(x, na.rm = TRUE)}\")\n\n# Paths and arguments\ncli_text(\"Reading from {.path \u002Fdata\u002Ffile.csv}\")\ncli_text(\"Set {.arg na.rm} to TRUE\")\n\n# Types and classes\ncli_text(\"Object is {.cls data.frame}\")\n\n# Emphasis\ncli_text(\"This is {.emph important}\")\ncli_text(\"This is {.strong critical}\")\n\n# Fields\ncli_text(\"The {.field name} field is required\")\n```\n\n### Vector Collapsing\n\nVectors are automatically collapsed with commas and \"and\":\n\n```r\npkgs \u003C- c(\"dplyr\", \"tidyr\", \"ggplot2\")\ncli_text(\"Installing packages: {.pkg {pkgs}}\")\n#> Installing packages: dplyr, tidyr, and ggplot2\n\nfiles \u003C- c(\"data.csv\", \"script.R\")\ncli_text(\"Found {length(files)} file{?s}: {.file {files}}\")\n#> Found 2 files: data.csv and script.R\n```\n\n### Escaping Braces\n\nUse double braces `{{` and `}}` to escape literal braces:\n\n```r\ncli_text(\"Use {{variable}} syntax in glue\")\n#> Use {variable} syntax in glue\n```\n\n**For complete markup reference**: See [references\u002Finline-markup.md](references\u002Finline-markup.md) for all 50+ inline classes, edge cases, nesting rules, and advanced patterns.\n\n## Pluralization Basics\n\nUse `{?}` for pluralization with three patterns:\n\n### Single Alternative\n\n```r\nnfile \u003C- 1\ncli_text(\"Found {nfile} file{?s}\")\n#> Found 1 file\n\nnfile \u003C- 3\ncli_text(\"Found {nfile} file{?s}\")\n#> Found 3 files\n```\n\n### Two Alternatives\n\n```r\nndir \u003C- 1\ncli_text(\"Found {ndir} director{?y\u002Fies}\")\n#> Found 1 directory\n\nndir \u003C- 5\ncli_text(\"Found {ndir} director{?y\u002Fies}\")\n#> Found 5 directories\n```\n\n### Three Alternatives (zero\u002Fone\u002Fmany)\n\n```r\nnfile \u003C- 0\ncli_text(\"Found {nfile} file{?s}: {?no\u002Fthe\u002Fthe} file{?s}\")\n#> Found 0 files: no files\n\nnfile \u003C- 1\ncli_text(\"Found {nfile} file{?s}: {?no\u002Fthe\u002Fthe} file{?s}\")\n#> Found 1 file: the file\n\nnfile \u003C- 3\ncli_text(\"Found {nfile} file{?s}: {?no\u002Fthe\u002Fthe} file{?s}\")\n#> Found 3 files: the files\n```\n\n### Helpers: qty() and no()\n\nUse `no()` to display \"no\" instead of zero:\n\n```r\nnfile \u003C- 0\ncli_text(\"Found {no(nfile)} file{?s}\")\n#> Found no files\n```\n\nUse `qty()` to set quantity explicitly:\n\n```r\nnupd \u003C- 3\nntotal \u003C- 10\ncli_text(\"{nupd}\u002F{ntotal} {qty(nupd)} file{?s} {?needs\u002Fneed} updates\")\n#> 3\u002F10 files need updates\n```\n\n**For advanced pluralization**: See [references\u002Finline-markup.md](references\u002Finline-markup.md) for edge cases and complex patterns.\n\n## CLI Conditions: Core Patterns\n\nUse cli conditions instead of base R for better formatting:\n\n### cli_abort() - Formatted Errors\n\n```r\n# Before (base R)\nstop(\"File not found: \", path)\n\n# After (cli)\ncli_abort(\"File {.file {path}} not found\")\n\n# With bullets for context\ncheck_file \u003C- function(path) {\n  if (!file.exists(path)) {\n    cli_abort(c(\n      \"File not found\",\n      \"x\" = \"Cannot read {.file {path}}\",\n      \"i\" = \"Check that the file exists\"\n    ))\n  }\n}\n```\n\n### cli_warn() - Formatted Warnings\n\n```r\n# Before (base R)\nwarning(\"Column \", col, \" has missing values\")\n\n# After (cli)\ncli_warn(\"Column {.field {col}} has missing values\")\n\n# With context\ncli_warn(c(\n  \"Data quality issues detected\",\n  \"!\" = \"Column {.field {col}} has {n_missing} missing value{?s}\",\n  \"i\" = \"Consider using {.fn tidyr::drop_na}\"\n))\n```\n\n### cli_inform() - Formatted Messages\n\n```r\n# Before (base R)\nmessage(\"Processing \", n, \" files\")\n\n# After (cli)\ncli_inform(\"Processing {n} file{?s}\")\n\n# With structure\ncli_inform(c(\n  \"v\" = \"Successfully loaded {.pkg dplyr}\",\n  \"i\" = \"Version {packageVersion('dplyr')}\"\n))\n```\n\n### Bullet Types\n\n- `\"x\"` - Error\u002Fproblem (red X)\n- `\"!\"` - Warning (yellow !)\n- `\"i\"` - Information (blue i)\n- `\"v\"` - Success (green checkmark)\n- `\"*\"` - Bullet point\n- `\">\"` - Arrow\u002Fpointer\n\n**For advanced error design**: See [references\u002Fconditions.md](references\u002Fconditions.md) for error design principles, rlang integration, testing strategies, and real-world patterns.\n\n## Basic Progress Indicators\n\n### Simple Progress Steps\n\n```r\nprocess_data \u003C- function() {\n  cli_progress_step(\"Loading data\")\n  data \u003C- load_data()\n\n  cli_progress_step(\"Cleaning data\")\n  clean \u003C- clean_data(data)\n\n  cli_progress_step(\"Analyzing data\")\n  analyze(clean)\n}\n```\n\n### Basic Progress Bar\n\n```r\nprocess_files \u003C- function(files) {\n  cli_progress_bar(\"Processing files\", total = length(files))\n\n  for (file in files) {\n    process_file(file)\n    cli_progress_update()\n  }\n}\n```\n\n### Auto-Cleanup\n\nProgress bars auto-close when the function exits:\n\n```r\nprocess \u003C- function() {\n  cli_progress_bar(\"Working\", total = 100)\n  for (i in 1:100) {\n    Sys.sleep(0.01)\n    cli_progress_update()\n  }\n  # No need to call cli_progress_done() - auto-closes\n}\n```\n\n**For advanced progress**: See [references\u002Fprogress.md](references\u002Fprogress.md) for nested progress, custom formats, parallel processing, all progress variables, and Shiny integration.\n\n## Semantic CLI Elements\n\n### Headers\n\n```r\ncli_h1(\"Main Section\")\ncli_h2(\"Subsection\")\ncli_h3(\"Detail\")\n```\n\n### Alerts\n\n```r\ncli_alert_success(\"Operation completed successfully\")\ncli_alert_danger(\"Critical error occurred\")\ncli_alert_warning(\"Potential issue detected\")\ncli_alert_info(\"Additional information available\")\n```\n\n### Text and Code\n\n```r\n# Regular text with markup\ncli_text(\"This is formatted text with {.emph emphasis}\")\n\n# Code blocks\ncli_code(c(\n  \"library(dplyr)\",\n  \"mtcars %>% filter(mpg > 20)\"\n))\n\n# Verbatim text (no formatting)\ncli_verbatim(\"This is displayed exactly as-is: {not interpolated}\")\n```\n\n### Lists\n\n```r\n# Unordered list\ncli_ul()\ncli_li(\"First item\")\ncli_li(\"Second item\")\ncli_end()\n\n# Ordered list\ncli_ol()\ncli_li(\"First step\")\ncli_li(\"Second step\")\ncli_end()\n\n# Definition list\ncli_dl()\ncli_li(c(name = \"The name field\"))\ncli_li(c(email = \"The email address\"))\ncli_end()\n```\n\n## Common Workflows\n\n### Base R to CLI Migration\n\n```r\n# Before: Base R error handling\nvalidate_input \u003C- function(x, y) {\n  if (!is.numeric(x)) {\n    stop(\"x must be numeric\")\n  }\n  if (length(y) == 0) {\n    stop(\"y cannot be empty\")\n  }\n  if (length(x) != length(y)) {\n    stop(\"x and y must have the same length\")\n  }\n}\n\n# After: CLI error handling\nvalidate_input \u003C- function(x, y) {\n  if (!is.numeric(x)) {\n    cli_abort(c(\n      \"{.arg x} must be numeric\",\n      \"x\" = \"You supplied a {.cls {class(x)}} vector\",\n      \"i\" = \"Use {.fn as.numeric} to convert\"\n    ))\n  }\n\n  if (length(y) == 0) {\n    cli_abort(c(\n      \"{.arg y} cannot be empty\",\n      \"i\" = \"Provide at least one element\"\n    ))\n  }\n\n  if (length(x) != length(y)) {\n    cli_abort(c(\n      \"{.arg x} and {.arg y} must have the same length\",\n      \"x\" = \"{.arg x} has length {length(x)}\",\n      \"x\" = \"{.arg y} has length {length(y)}\"\n    ))\n  }\n}\n```\n\n### Error Message with Rich Context\n\n```r\ncheck_required_columns \u003C- function(data, required_cols) {\n  actual_cols \u003C- names(data)\n  missing_cols \u003C- setdiff(required_cols, actual_cols)\n\n  if (length(missing_cols) > 0) {\n    cli_abort(c(\n      \"Required column{?s} missing from data\",\n      \"x\" = \"Missing {length(missing_cols)} column{?s}: {.field {missing_cols}}\",\n      \"i\" = \"Data has {length(actual_cols)} column{?s}: {.field {actual_cols}}\",\n      \"i\" = \"Add the missing column{?s} or check for typos\"\n    ))\n  }\n\n  invisible(data)\n}\n```\n\n### Function with Progress Bar\n\n```r\nprocess_files \u003C- function(files, verbose = TRUE) {\n  n \u003C- length(files)\n\n  if (verbose) {\n    cli_progress_bar(\n      format = \"Processing {cli::pb_bar} {cli::pb_current}\u002F{cli::pb_total} [{cli::pb_eta}]\",\n      total = n\n    )\n  }\n\n  results \u003C- vector(\"list\", n)\n\n  for (i in seq_along(files)) {\n    results[[i]] \u003C- process_file(files[[i]])\n\n    if (verbose) {\n      cli_progress_update()\n    }\n  }\n\n  results\n}\n```\n\n## Resources & Advanced Topics\n\n### Reference Files\n\n- **[references\u002Finline-markup.md](references\u002Finline-markup.md)** - Complete catalog of inline classes organized by category, advanced patterns, nesting rules, and real-world examples\n\n- **[references\u002Fconditions.md](references\u002Fconditions.md)** - Advanced error design patterns, rlang integration, testing with testthat snapshots, migration guide, and anti-patterns\n\n- **[references\u002Fprogress.md](references\u002Fprogress.md)** - Nested progress bars, custom formats, all progress variables, parallel processing, Shiny integration, and debugging\n\n- **[references\u002Fthemes.md](references\u002Fthemes.md)** - Complete theming system with CSS-like selectors, container functions, color palettes, custom themes, and accessibility\n\n- **[references\u002Fansi-operations.md](references\u002Fansi-operations.md)** - ANSI string operations (align, columns, nchar, etc.), hyperlinks, color detection, testing CLI output, and troubleshooting\n\n### External Resources\n\n- [cli package documentation](https:\u002F\u002Fcli.r-lib.org)\n- [cli GitHub repository](https:\u002F\u002Fgithub.com\u002Fr-lib\u002Fcli)\n- [Building a semantic CLI (article)](https:\u002F\u002Fcli.r-lib.org\u002Farticles\u002Fsemantic-cli.html)\n\n### Related Packages\n\n- **rlang** - Condition handling and error objects integrate with cli\n- **glue** - String interpolation powers cli's `{}` syntax\n- **testthat** - Snapshot testing for cli output\n",{"name":5,"license":15,"metadata":24,"description":7,"allowed-tools":27,"user-invocable":32},{"author":25,"version":26},"Garrick Aden-Buie (@gadenbuie)","1.0",[28,29,30,31],"Read","Edit","Write","Bash",true,"main","0f720481f8ce3b3d9fef485f6e230d8b3035748e","skills\u002Fcli",1,"https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config","https:\u002F\u002Fmorrison-lab.github.io\u002Fai-config\u002F","https:\u002F\u002Fgithub.com\u002FMorrison-Lab","2026-11-15 04:39:15",{"source":8,"skillName":5,"commands":42,"prompt":52,"zipAvailable":32},[43,46,49],{"tool":44,"command":45},"npx","npx skills add Morrison-Lab\u002Fai-config --skill cli",{"tool":47,"command":48},"bunx","bunx skills add Morrison-Lab\u002Fai-config --skill cli",{"tool":50,"command":51},"pnpm","pnpm dlx skills add Morrison-Lab\u002Fai-config --skill cli","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fcli\u002FSKILL.md",[54,60,64,68,72],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fansi-operations.md","REFERENCE","参考文档",19797,"https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fcli\u002Freferences\u002Fansi-operations.md",{"path":61,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fconditions.md",18912,"https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fcli\u002Freferences\u002Fconditions.md",{"path":65,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Finline-markup.md",19810,"https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fcli\u002Freferences\u002Finline-markup.md",{"path":69,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fprogress.md",20581,"https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fcli\u002Freferences\u002Fprogress.md",{"path":73,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fthemes.md",13738,"https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fcli\u002Freferences\u002Fthemes.md",[77,84,91,98,105,112],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M735BVYCGR5VEC65AFDVSNKW","wrap-up","End-of-session verification and UMS.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwrap-up\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M735BTH469T1CQ8G2Q9GENCR","workaround-watcher","Watch upstream issue for fix.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fworkaround-watcher\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M735BRKZWFANSQ0GM380B4TD","wn","→ whats-next.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwn\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M735BPE9V830B3B6NGXQ56J6","whats-next","Recommend concrete next step or action.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwhats-next\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":19},"01M735BMHQ60EAD5B7QAWXC5A0","wait-for-results","Wait for pipeline\u002FCI results.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwait-for-results\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":19},"01M735BKGZHPN1PEMJ7YBD5VJ8","wai","→ send-notes.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwai\u002FSKILL.md",[],[]]