r-lib-cli-app

Author R-based CLIs with Rapp using top-level option declarations and subcommands.

1|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/nq-rdl/agent-extensions --skill r-lib-cli-app
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: r-lib-cli-app
Source: https://github.com/nq-rdl/agent-extensions/tree/main/skills/r-lib-cli-app
Command: npx skills add https://github.com/nq-rdl/agent-extensions --skill r-lib-cli-app

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Streamlines turning ordinary R scripts into robust, command-line tools by providing a standardized CLI layer with argument parsing, subcommands, and automated help.

Core Features & Use Cases

  • Rapp-based CLI: a drop-in replacement for Rscript that automatically generates CLI interfaces from top-level expressions.
  • Subcommand support: organize tools using switch() patterns for get/set/list style CLIs.
  • Cross-platform distribution: ship CLIs in packages or as standalone scripts, with consistent help and defaults.

Quick Start

Install the Rapp package, write top-level R expressions with a shebang, and run the script as a CLI tool.

Frequently Asked Questions about r-lib-cli-app

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an R command-line tool with subcommands?

You can create an R command-line tool by using Rapp to declare CLI options and switch-based subcommands via top-level assignments. This automatically generates the required argument parsing and help text for your R scripts.

Can I turn a standalone R script into a CLI without building a full package?

Yes, you can turn a standalone R script into a CLI by adding a shebang and writing top-level R expressions. Rapp works across packaging scenarios, allowing you to ship robust command-line tools without requiring an R package structure.

What is the best way to generate help text automatically for R scripting tools?

The best way to generate help text automatically is to use Rapp, which builds your CLI interface directly from top-level expressions. This provides consistent help generation and defaults without requiring manual documentation setup.

Does Rapp support switch-based subcommands for get/set/list style command-line apps?

Yes, Rapp supports switch-based subcommands for get/set/list style command-line apps. You can organize your R scripting tools using standard switch() patterns to handle distinct subcommand logic cleanly.

Why use Rapp instead of Rscript for running command-line R applications?

Use Rapp instead of Rscript to get a standardized CLI layer that automatically parses arguments and generates help. Rapp acts as a drop-in replacement that transforms ordinary R scripts into robust command-line applications.