Reference

This page shows the current CLI help for ir.

ir

Run self-describing R scripts

Usage: ir [COMMAND]

Commands:
  run         Run a script or inline R expression
  render      Render a Quarto document or script
  tool        Run package executables
  quickstart  Show a concise usage guide for AI agents
  cache       Manage ir's cache
  help        Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Examples:
  ir run script.R
  ir render report.qmd
  ir tool run btw
  ir cache dir

ir run

Run a script or inline R expression

Usage: ir run [OPTIONS] [ARGS]...

Arguments:
  [ARGS]...  Rscript options, script path, and script arguments

Options:
  -e, --expr <EXPR>                  Evaluate an inline R expression instead of a script file
      --with <PKG>                   Add a dependency for this run; may be repeated
      --r-version <SPEC>             Select the R version for this run with rig
      --rscript <RSCRIPT>            Select the Rscript executable
      --exclude-newer <DATE>         Resolve packages from the Posit Package Manager snapshot at this date
      --python-exclude-newer <DATE>  Resolve Python packages using this snapshot date
      --isolated                     Disable the user library for this run
  -h, --help                         Print help

Examples:
  ir run script.R
  ir run script.R input.csv --verbose
  ir run -e 'print("hello")'

  ir run --with cli --vanilla script.R --input data.csv
      # --with is for ir; --vanilla is for Rscript.
      # --input data.csv is passed to script.R.

  ir run --with cli -e 'print(commandArgs(TRUE))' --input data.csv
      # --input data.csv is passed to commandArgs(TRUE).

ir render

Render a Quarto document or script

Usage: ir render [OPTIONS] <SOURCE> [QUARTO_ARGS]...

Arguments:
  <SOURCE>          Quarto document or script to render
  [QUARTO_ARGS]...  Arguments passed to `quarto render`

Options:
      --with <PKG>                   Add a dependency for this render; may be repeated
      --r-version <SPEC>             Select the R version for this render with rig
      --rscript <RSCRIPT>            Select the Rscript executable
      --exclude-newer <DATE>         Resolve packages from the Posit Package Manager snapshot at this date
      --python-exclude-newer <DATE>  Resolve Python packages using this snapshot date
      --isolated                     Disable the user library for this render
      --vanilla                      Pass --vanilla to the Rscript used by Quarto
  -h, --help                         Print help

Examples:
  ir render report.qmd
  ir render report.qmd --to html

  ir render --with ggplot2 report.qmd --to html
      # --with is for ir; --to html is passed to quarto render.

  ir render --vanilla slides.qmd --output slides.html
      # --vanilla is passed to the Rscript used by Quarto.
      # --output slides.html is passed to quarto render.

ir tool

Run package executables

Usage: ir tool [COMMAND]

Commands:
  run      Run an executable provided by an R package
  install  Install package executables
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

Tools:
  A tool is a supported executable in an R package's exec/, bin/, or
  architecture-specific bin/<arch>/ directory. exec/ supports Rscript, Rapp,
  and direct executable scripts; bin/ entries are run as-is.
  `ir tool run` resolves the package plus any --with dependencies into an
  isolated library, then runs the selected executable. The user R library is not
  used.
  `ir tool install` materializes a durable package library, then writes
  launchers backed by that library.

ir tool run

Run an executable provided by an R package

Usage: ir tool run [OPTIONS] [ARGS]...

Arguments:
  [ARGS]...  Rscript options, package ref or command, and tool arguments

Options:
      --from <PKG_REF>     Resolve a package ref and run <command> from that package
  -w, --with <PKG>         Add a dependency for this tool run; may be repeated
      --r-version <SPEC>   Select the R version for this tool run with rig
      --rscript <RSCRIPT>  Select the Rscript executable
  -h, --help               Print help

Tool discovery:
  Supported executables are discovered from installed package exec/, bin/,
  and architecture-specific bin/<arch>/ directories. exec/ supports Rscript,
  Rapp, and direct executable scripts; bin/ entries are run as-is.

Examples:
  ir tool run btw
  ir tool run btw --help
      # btw is shorthand for --from btw btw.

  ir tool run --from btw --vanilla btw --input data.csv
      # --from is for ir; --vanilla is for Rscript.
      # --input data.csv is passed to the btw executable.

ir tool install

Install package executables

Usage: ir tool install [OPTIONS] <PKG_REF>

Arguments:
  <PKG_REF>  Package ref that provides executables to install

Options:
      --with <PKG>         Add a dependency for installed tools; may be repeated
      --r-version <SPEC>   Select the R version for installed tools with rig
      --rscript <RSCRIPT>  Select the Rscript executable
      --bin-dir <DIR>      Directory where executables are installed
      --force              Overwrite an existing installed executable path
  -h, --help               Print help

Tool discovery:
  Supported executables are discovered from installed package exec/, bin/,
  and architecture-specific bin/<arch>/ directories. exec/ supports Rscript,
  Rapp, and direct executable scripts; bin/ entries are run as-is.

Install storage:
  `ir tool install` materializes the package library under the durable tool
  store, configurable with IR_TOOL_STORE_DIR, then installs command names
  into --bin-dir as launchers backed by that library.

Examples:
  ir tool install btw
  ir tool install --bin-dir ~/.local/bin btw
  ir tool install --with cli --bin-dir ~/.local/bin btw

ir cache

Manage ir's cache

Usage: ir cache [COMMAND]

Commands:
  clean  Clear the cache, removing all entries
  dir    Show the cache directory
  help   Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

ir cache dir

Show the cache directory

Usage: ir cache dir

Options:
  -h, --help  Print help

ir cache clean

Clear the cache, removing all entries

Usage: ir cache clean [OPTIONS]

Options:
      --force  Accepted for compatibility; same as `ir cache clean`
  -h, --help   Print help

ir quickstart

Show a concise usage guide for AI agents

Usage: ir quickstart

Options:
  -h, --help  Print help