/rpix:rpixfrom rpix
Manages R packages and environments in Pixi projects. Handles installing CRAN/Bioconductor/GitHub packages via pixi.toml, running R scripts with the project's R, and troubleshooting R startup or missing package errors.
Ships in rpix. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A Pixi project keeps R itself, its packages and the system libraries they need in an environment inside the project (.pixi/envs/<name>/), from conda-forge and bioconda. pixi.toml records what was asked for, pixi.lock the exact builds for every platform. rpix is the R package that drives Pixi from R. Everything below follows from one rule: R and its packages come from Pixi, so the lock file stays the truth.
rpix::pixi_add(), or pixi add r-<name> in a terminal. Never install.packages(), pak, remotes, BiocManager::install(), devtools::install_deps() or renv: they write into the environment's library behind Pixi's back, so nothing records them, collaborators and CI don't get them, and Pixi can remove or strand them.pixi run Rscript script.R, pixi run Rscript -e '...', or a task (pixi run <task>). A bare R or Rscript is another R, with other packages. Never point another R at .pixi/ (.libPaths(), R_LIBS): packages built for one R crash another.pixi.lock to Pixi. Never edit it. Editing pixi.toml is fine, then run pixi lock (or pixi install) so the lock follows. Commit both; never commit the environments in .pixi/.references/setup-and-sharing.md.run-post-link-scripts), building a package from source, installing Pixi, or anything that needs a login. rpix asks these itself in an interactive R; from a script it doesn't ask, but stops or warns with the command to run. Put the choice to the user, then run what it printed.rpix::pixi_auth_login() in their own interactive R.reference/<page>.md). The installed rpix is what runs, and may be older: pixi run Rscript -e 'args(rpix::pixi_add)'. For Pixi, pixi <command> --help, or https://pixi.prefix.dev/latest/llms.txt.rpix works from any R and finds the project by looking upwards from the working directory for pixi.toml. Function names below are bare; from a shell, write them as rpix::. In order of preference:
pixi run Rscript -e 'rpix::pixi_add("dplyr")': the environment's R, where use_pixi() installed rpix.Rscript -e 'rpix::pixi_add("dplyr")': the user's usual R, if rpix is installed there. Fine for rpix's functions, which only drive Pixi; never for the project's own code.pixi add r-dplyr. rpix prints each Pixi command it runs, and dry_run = TRUE shows it without running it.rpix is in pixi.toml as r-rpix. It isn't on conda-forge yet, so it comes from the channel https://prefix.dev/roaldarbol/rpix-forge, which use_pixi() adds after conda-forge. A project set up by an earlier rpix, or another environment, may lack it (pixi run Rscript -e 'packageVersion("rpix")'); then use 2 or 3, or run use_pixi() again from the user's usual R, which keeps the project's versions and adds rpix.
rpix needs Pixi 0.77 or later (pixi --version). In an interactive R, rpix offers to do a next step itself, such as setting up a project where there's none or adding what DESCRIPTION comes to need; from a script it doesn't ask, and prints the call instead.
For more than a line of R, write a script and pixi run Rscript script.R rather than fight shell quoting. The first pixi run or pixi install downloads R and every package: allow several minutes, and run Pixi commands one at a time.
| You write | Conda package | From |
|---|---|---|
"dplyr", "Rcpp", "data.table" | r-dplyr, r-rcpp, r-data.table | conda-forge |
"bioc::DESeq2", or "DESeq2" | bioconductor-deseq2 | bioconda, added to the project's channels |
"conda::quarto", "conda::gdal" (not R packages) | quarto, gdal | conda-forge |
"github::user/repo@ref" | built from source (experimental) | GitHub |
Add them in one call, pixi_add(c("dplyr", "bioc::DESeq2")), so Pixi solves once. A version constraint follows the name ("dplyr>=1.1"); feature = adds to a feature rather than the default one. pixi_scan(add = TRUE) adds the packages the code uses that pixi.toml lacks.
When a package can't be added, go down this list and stop at the first that applies:
pixi_search("name"). A Bioconductor package takes bioc::, a conda package that isn't an R package conda::.pixi_add(c("r-base=4.5", "bioc::DESeq2")).win-64 among its platforms can't have Bioconductor packages. Tell the user; don't drop the platform unasked.pixi_add("github::cran/<pkg>"), or @1.2.3 for a version. Experimental: ask first.pixi_add("github::user/repo@ref"), with the same caveat. It can't yet depend on packages that are themselves built from source, or on Bioconductor packages, and may fail to build if it needs a system library R doesn't bring along.install.packages(). The lasting fix is a conda-forge recipe: pixi exec rattler-build generate-recipe cran <pkg>, submitted to conda-forge's staged-recipes.Bioconductor's annotation and data packages (org.Hs.eg.db, GO.db, TxDb.*, BSgenome.*) download their data in an install script, which Pixi skips unless the checkout allows it. rpix then warns that the package isn't fully installed, and it won't load. Allowing it (pixi config set --local run-post-link-scripts insecure, then pixi reinstall <conda-name>) runs the package's own code with the user's permissions, so it's the user's call. The setting goes in .pixi/config.toml, which Pixi's .gitignore leaves committable: committed, it allows the scripts for everyone who clones, so that's the user's call too; uncommitted, every checkout and CI job needs it.
Names, versions, CLI equivalents, source builds and Bioconductor in detail: references/packages.md.
Diagnose before fixing:
pixi run Rscript -e 'rpix::pixi_sitrep()'
It reports on Pixi, the project, whether pixi.lock matches pixi.toml, whether R is the project's and activated, libraries and packages from outside the project, packages installed without Pixi, the .Rprofile block, logins, files that more than one package in an environment installs (e.g. Strawberry Perl's MinGW runtime on Windows), and in a package whether pixi.toml covers DESCRIPTION, each with its fix. Run like this, it describes the R that pixi run starts; for the user's IDE, ask them to run rpix::pixi_sitrep() in its console and share the output.
When it can't run, or for a first look:
pixi --version fails: Pixi isn't installed, or isn't on the PATH (it installs into ~/.pixi/bin). Ask before installing it.pixi run fails before R starts: read Pixi's error. Usually a package name, a package not built for this R or platform, a channel refusing access (the user logs in), or an exclude-newer date.there is no package called 'x': Is x in pixi.toml? (pixi_scan() lists what the code uses but pixi.toml lacks.) Is it one of R's recommended packages, which conda-forge's R leaves out (MASS, Matrix, lattice, survival, mgcv, nlme...)? Add those like any other. Was the code run with the project's R?R.home() must be inside .pixi/envs/, and .libPaths() must not list a personal library.Symptom by symptom, with rpix's messages: references/troubleshooting.md.
use_pixi(ide = "positron") (or "rstudio", "vscode", "emacs", "neovim", "zed", and "jupyter" for notebooks, experimental), then pixi_scan(add = TRUE). It adds R, rpix, conda-ecosystem-user-package-isolation (keeps the personal library out) and an .Rprofile block (activates the environment when an IDE starts R): keep all of them. r_version = and date = set R's version and a package date up front.pixi.toml and pixi.lock; collaborators run pixi_install() from their usual R (or pixi install), then open the project in their IDE. use_pixi() makes a project for Linux, macOS (Intel and Apple Silicon) and Windows; pixi_add_platform() and pixi_remove_platform() change that.use_pixi(date = ) for a new project, pixi_set_date() for an existing one.pixi_add_environment("r44", r_version = "4.4") for another R in one step; features and environments in references/environments.md.DESCRIPTION stays the source of truth. pixi_import_description() brings its dependencies into pixi.toml, pixi_add("rlang", type = "Imports") adds one to both files, use_pixi_check_matrix() and pixi_check_matrix() test across R versions and minimum versions, and use_pixi_github_action() writes CI from the lock file. See references/package-development.md.references/setup-and-sharing.md..Rprofile reroutes install.packages("x") to pixi_add(), when rpix is installed there. utils::install.packages() bypasses it.pixi add pins what it adds (>=1.1.4,<2). Loosen a pin in pixi.toml if needed, then pixi lock.pixi list or pixi tree, not by reading pixi.lock, which is large. Leave .pixi/ out of searches.pixi.lock, resolve pixi.toml, take either side's lock, and run pixi lock. Never merge the lock by hand.conda::quarto, then pixi run quarto render report.qmd.pixi.toml manifest rather than pyproject.toml: GitHub packages, dates, the minimum environment.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub roaldarbol/rpix --plugin rpixOther plugins' skills for the same job