Skip to content

Overview and Global Options

rv aims to provide users with commands that make package management and installation simple. To accomplish this, we have various “types” of commands which give users the ability to set up and configure their projects, install packages, and inspect their project status and other information.

Create, initialize, or migrate a project.

  • rv init - Initialize a new or existing project with the necessary project infrastructure.
  • rv migrate renv - Initialize an existing renv project by migrating the renv.lock to an rv config file.

Sync the project library to the config and lock files.

  • rv sync - The basic command to install packages
  • rv upgrade - Install packages while ignoring the lockfile

Edit the config file without opening it directly.

  • rv add - Quickly add packages to the config file and sync
  • rv remove - Quickly remove packages from the config file and sync
  • rv configure repository - Configure the repositories section of the config file

See what will happen before it happens.

  • rv plan - Show the results if you were to run rv sync. A more granular view.
  • rv summary - Inspect your project on a global level, indicating information like how packages need to be installed and the source of packages.

Inspect information about the project.

  • rv tree - Show the dependency tree for the project’s dependencies
  • rv cache - Returns the cache directories used in the project
  • rv library - Returns the relative path to the library in UNIX-format
  • rv info - Returns simple information about the project. Primarily used for project activation
  • rv sysdeps - List the system dependencies needed by the dependency tree (Ubuntu, Debian, RHEL-family, and openSUSE/SLE only)

A few other commands which can be used to control your project:

  • rv fmt - Format the configuration file to ensure consistent styling, while maintaining spacing and comments
  • rv activate - Activate a previously initialized rv project
  • rv deactivate - Deactivate an rv project
  • rv run - Run an Rscript command with the project library configured, syncing first by default
  • rv export renv - Export the project’s lock file to renv.lock format

Each command has the following global options:

  • --config-file - the path to a config file. Defaults to rproject.toml in the current directory. Unless otherwise specified in the config file, the library will be synced at the level of the config file, not in the working directory.
  • --verbose (-v) - increase the logging verbosity
  • --quiet (-q) - decrease logging verbosity
  • --json - print the output as JSON format. This will ignore the --verbose and --quiet flag and not log anything.
  • --emit-events - stream progress as NDJSON to stdout instead of normal output, suppressing everything else. Intended for IDE/GUI integrations driving rv programmatically rather than interactive use. Conflicts with --json. Introduced in rv v0.22.0