Build an R command-line tool with AI
Turn the inputs of an existing script into documented arguments, defaults and subcommands that colleagues can use without editing the source.
Build an R command-line tool with AI when the team keeps duplicating a reporting script just to change two paths. The r-cli-app skill helps an agent use Rapp to turn selected top-level expressions into a command interface. The source remains recognisable as an R script while the caller can supply values at launch.
An input directory, an output directory and a recursive flag make a useful first example. Decide which values are required and what should happen when a flag is omitted. Testing those decisions in a disposable directory is cheaper than discovering that a tool overwrites yesterday’s report.
What it does
- Turn common settings into named options with clear defaults.
- Distinguish positional arguments from optional switches.
- Add help text that explains where a value comes from.
- Group separate operations under subcommands when appropriate.
- Test how the command handles a realistic invocation before installing its launcher.
Install and use
- Provide a permitted R script, a compatible R installation and the official Rapp package. Use a writable test directory for examples that produce files.
- Ask, “Give this report script input and output options, write its help and check where one sample report would land.”
- Compare the command’s result with the original script before sharing the launcher.
FAQ
Source
Made by Garrick Aden-Buie. Original skill: r-cli-app, published on GitHub under the MIT licence.
View on GitHub